Disappearing session variables is usually 1 of 2 things.
1) You aren't starting the session on the page. PHP requires the session to be started before you can refer to a session variable. Maybe try just adding:
<?php
@session_start();
?>
To the top of the page where the session variables aren't working.
2) It is a server configuration issue. If the session.save_path is set wrong in the php.ini file (set to a non-existent directory or one with incorrect permissions), then it can't effectively save the session variables. If #1 doesn't seem to work, check the session.save_path setting and make sure it looks correct.