RE: [PHP] HELP, problems with sessions.....

From: Date: Wed, 09 May 2001 16:00:37 +0000
Subject: RE: [PHP] HELP, problems with sessions.....
Groups: php.general 
Request: Send a blank email to php-general+get-52127@lists.php.net to get a copy of this message
My guess is one server has register_globals on, the other has register_globals off. Try this change in your code: instead of assigning a value to $HTTP_SESSION_VARS["toto"], instead assign a value to $toto. You will then see a value for $toto in the echo session_encode(). $HTTP_SESSION_VARS["toto"] and $toto are *not* the same variables while on the current page. The other way to approach it is to use an .htaccess file to turn register_globals off but leave your code as it is below. Again, you will then see a value for $toto in the echo session_encode(). Kirk > -----Original Message----- > but here that's whats not going: > <? > session_start(); > if(!isset($HTTP_SESSION_VARS["toto"])) > { > echo " hell no toto defined!!!!"; > session_register("toto"); > $HTTP_SESSION_VARS["toto"] = "hello"; > }//if(!isset($HTTP_SESSION_VARS["toto"])) > else echo " toto was set > to:'".$HTTP_SESSION_VARS["toto"]."'<BR>"; > > ... rest of the page that has nothing to do with this session ... > echo "<HR>\nsession:"; > echo session_encode(); > echo "<P>debug, after the run: num of sess > vars:".count($HTTP_SESSION_VARS)."<BR>\n"; > reset ($HTTP_SESSION_VARS); > while (list ($key, $val) = each ($HTTP_SESSION_VARS )) > { > echo "Sesvar '$key' = '$val'<BR>\n"; > }//while (list ($key, $val) = each ($HTTP_SESSION_VARS ) > ?> > > this is basicly what i have, and that is working on one > machine and not on > another....

« previous php.general (#52127) next »