The syntax for setting the session variable looks valid in both cases.
in the first, you are retrieving the value from the recordset, in the second you are retrieving it from the URL variable.
the headers already sent error... difficult for me to investigate.
also, the menu.php you posted has no html markup.
sorry, but i am having difficulty in trying to see what you are attempting.
is it possible you could post a link ?