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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 20:01:32 2024 UTC