It should work with sessions as well, you may need to add a session start command line of the page to force it to see the session:
<?php @session_start(); ?>
when in doubt, add the session binding to the body of the page to double check that it is returning a value.