php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7772 Problems with session vars
Submitted: 2000-11-12 20:28 UTC Modified: 2001-03-16 17:32 UTC
From: jkohen at tough dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.3pl1 OS: Linux
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: jkohen at tough dot com
New email:
PHP Version: OS:

 

 [2000-11-12 20:28 UTC] jkohen at tough dot com
Apache/1.3.14 (Unix) PHP/4.0.3pl1
# "If both track_vars and register_globals are enabled, then the globals variables and the $HTTP_SESSION_VARS entries will reference the same value." - PHP Manual.
# In the next example $HTTP_SESSION_VARS[xyzzy] can only be read, if it's written, the new value is lost, it doesn't get saved through requests.
# Besides that, setting $xyzzy to something isn't reflected in its $HTTP_SESSION_VARS counterpart until the next request.

session_register("xyzzy");
$HTTP_SESSION_VARS[xyzzy] = 'nothing';
$xyzzy = 'something';
# Here, $HTTP_SESSION_VARS[xyzzy] is equal to 'nothing'.
$HTTP_SESSION_VARS[xyzzy] = 'somethingelse';
# Here, $HTTP_SESSION_VARS[xyzzy] is equal to 'somethingelse'.

# At the next request, $HTTP_SESSION_VARS[xyzzy] will be equal to 'something'.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-16 17:32 UTC] sas@php.net
The paragraph you quote only refers to the time of reinstantiating variables.  Registering a session variable does not cause $HTTP_SESSION_VARS["foo"] and $foo to become associated in any way.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 09:01:34 2025 UTC