Re: session data missing

From: Date: Wed, 09 Jul 2003 19:30:17 +0000
Subject: Re: session data missing
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-154623@lists.php.net to get a copy of this message
----- Original Message ----- From: "ulf sundin" <majikthse@spray.se> To: <php-general@lists.php.net> Sent: Wednesday, July 09, 2003 1:00 PM Subject: Re: [PHP] session data missing > ok, so now the variable names are registred and stored in the file. But > without values. > check this: > > --firstpage.php---- > session_start() > session_register('foo'); > $HTTP_SESSION_VARS['foo'] = 'bar'; > echo $HTTP_SESSION_VARS['foo']; //outputs bar; > > transport by a href to: > ----secondpage.php---- > session_start(); > echo $HTTP_SESSION_VARS['foo']; //outputs nothing > > --- > checking the contents of the file called /tmp/sess_{session_id}: > !foo| (snip) Make a choice here.. => session_register('foo'); => $HTTP_SESSION_VARS['foo'] = 'bar'; Use either the session_register() function or the session global array. Not both. - Kevin

« previous php.general (#154623) next »