note 14717 added to ref.session.php
| From: | vince at control-escape dot com | Date: | Sat, 11 Aug 2001 12:40:47 +0000 |
| Subject: | note 14717 added to ref.session.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16578@lists.php.net to get a copy of this message | ||
Documentation Bug: When both track_vars=on and register_globals=on, session variables may be READ
using the same syntax as track_vars=on and register_globals=off. However, variables cannot be SET
using this syntax.
With register_globals=on, the value of the session variable MUST be referenced from a global
variable or it is not preserved across pages.
For example, the following code works perfectly as expected when register_globals=off. The same code
fails to preserve the value of var1 when register_globals=on, despite the fact that it is registered
and has a value.
<?php
session_start();
print_r($HTTP_SESSION_VARS);
session_register('var1');
$HTTP_SESSION_VARS['var1']='val1';
?>
Tested on PHP 4.0.5, Windows NT 5.0 build 2195, Apache/1.3.20.
http://www.php.net/manual/en/ref.session.php