Re: Going backwards with sessions.
| From: | Michael McGlothlin | Date: | Wed, 14 Feb 2001 00:13:28 +0000 |
| Subject: | Re: Going backwards with sessions. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39534@lists.php.net to get a copy of this message | ||
I think you might need to session_register () the variables on each page you want to use them, not just once per session.
Doug Budny wrote:
I'm having a strange problem with sessions, it appears that they are not propagating to the next page. When I run the login page the sess vars get registered, the session_id() get's set, and the cookie sessId get's set. However when I go to the order page in a subdirectory only the cookie sessId comes over correctly. It will not set the session_id(). The only thing that prints as expected is the cookie var and $sessionId. I'm using 4.0.4pl1 on Redhad 6.2 apache 1.3.9 . enable_track_vars is enabled and so is register_globals. Am I doing something wrong or is Sessions broken in pl1? <?php// login pagesrand((double)microtime()*1000000); $sessionId = md5(uniqid(rand())); session_id($sessionId); session_start(); setcookie("sessId", $sessionId);session_register('clientid'); session_register('clientname'); session_register('rnum');?> <?php// order page$sessionId = $HTTP_COOKIE_VARS['sessId'];session_id($sesssionId); session_start();//global $clientname; //global $clientid;echo ('<br>Client ID :' . $clientid); echo ('<br>Rnumber :' . $rnum); echo ('<br>SessCli Name :' . $HTTP_SESSION_VARS['clientname']);echo ('<br>Session_Id() :' . session_id()); echo ('<br>Session_name() :' . session_name()); echo ('<br>sessId :' . $HTTP_COOKIE_VARS['sessId']);?>