PHP 4.0 Bug #8226 Updated: Problems with session vars(related to #7772)
| From: | martin at netconfigs dot com | Date: | Wed, 13 Dec 2000 13:03:29 +0000 |
| Subject: | PHP 4.0 Bug #8226 Updated: Problems with session vars(related to #7772) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-41170@lists.php.net to get a copy of this message | ||
ID: 8226
User Update by: martin@netconfigs.com
Status: Open
Bug Type: *Session related
Description: Problems with session vars(related to #7772)
alternative workaround to tie the global and the HTTP_SESSION_VARS item together:
while(list($k,$v) = each($HTTP_SESSION_VARS)) ${$k} = &$HTTP_SESSION_VARS[$k];
this causes changes to the global to be reflected in the HHTP_SESSIONS_VARS array - and vice-versa
Previous Comments:
---------------------------------------------------------------------------
[2000-12-13 07:47:39] martin@netconfigs.com
Session saved from globals dispite setting register_globals=off although session_encode() does what
is expected.
.htaccess:
php_flag register_globals off
php-script resulting in session file: "count|i:4321;"
<?php
session_register("count");
$HTTP_SESSION_VARS["count"]=1234;
$count=4321;
?>
php-script resulting in session file: "!count|"
<?php
session_register("count");
$HTTP_SESSION_VARS["count"]=1234;
?>
workaround - last line of script:
while(list($k,$v) = each($HTTP_SESSION_VARS)) ${$k} = $v;
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8226