php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8226 Problems with session vars(related to #7772)
Submitted: 2000-12-13 07:47 UTC Modified: 2000-12-14 07:03 UTC
From: martin at netconfigs dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.1pl2 OS: Linux2.2.16(SuSE7)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: martin at netconfigs dot com
New email:
PHP Version: OS:

 

 [2000-12-13 07:47 UTC] martin at netconfigs dot 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;


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-13 08:03 UTC] martin at netconfigs dot com
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
 [2000-12-14 06:47 UTC] stas@php.net
user reports as fixed.
 [2000-12-14 07:03 UTC] martin at netconfigs dot com
To be precise - it appears to be fixed in 'PHP Version 4.0.5-dev'
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 00:01:27 2025 UTC