PHP 4.0 Bug #5329: session variables are always empty when register_globals=off

From: Date: Sun, 02 Jul 2000 12:07:45 +0000
Subject: PHP 4.0 Bug #5329: session variables are always empty when register_globals=off
Groups: php.dev 
Request: Send a blank email to php-dev+get-23136@lists.php.net to get a copy of this message
From: mn@altern.org Operating system: Debian GNU/Linux 2.2 kernel 2.2 PHP version: 4.0.1pl2 PHP Bug Type: Session related Bug description: session variables are always empty when register_globals=off When register_globals = Off (as recommended in php.ini-optimized) session variables get registered in $HTTP_SESSION_VARS but their value appears to be always empty. -- file session-test.php -- <?php session_start(); $foo = "foo value"; session_register("foo"); session_register("bar"); $bar = "bar value"; print("<html><a href='session-test-2.php'>Go ahead.</a></html>"); ?> -- file session-test-2.php -- <?php session_start(); $isFoo = session_is_registered("foo") ? "is" : "is <b>not</b>"; $isBar = session_is_registered("bar") ? "is" : "is <b>not</b>"; print(" <html> Variable \$foo $isFoo registered. Its value is \"${HTTP_SESSION_VARS['foo']}\".<br> Variable \$bar $isBar registered. Its value is \"${HTTP_SESSION_VARS['bar']}\". </html> "); ?> Results: -- with register_globals = on Variable $foo is registered. Its value is "foo value". Variable $bar is registered. Its value is "bar value". -- with register_globals = off Variable $foo is registered. Its value is "". Variable $bar is registered. Its value is "". I've noticed this behaviour in 4.0.0 and it persist in 4.0.1pl2. My configure options: --with-apxs --with-mysql=/usr --disable-xml --disable-posix --disable-debug My ini file: the php.ini-optimized

« previous php.dev (#23136) next »