Bug #13831 Updated: Assigning to multi-dimensional $HTTP_SESSION_VARS array not restored

From: Date: Sun, 25 Nov 2001 01:09:09 +0000
Subject: Bug #13831 Updated: Assigning to multi-dimensional $HTTP_SESSION_VARS array not restored
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-71573@lists.php.net to get a copy of this message
ID: 13831 Updated by: sniper Reported By: shelby@DownloadFAST.com Old Status: Open Status: Feedback Bug Type: Session related Operating System: FreeBSD 4.2 PHP Version: 4.0.6 New Comment: Please try the latest CVS snapshot from http://snaps.php.net/ and if you can reproduce this with it, add a complete but short example script into this report. Previous Comments: ------------------------------------------------------------------------ [2001-10-25 20:42:44] shelby@DownloadFAST.com Further searching reveals this may be a duplicate or related to Bug id #12859. Perhaps my example/explanation is more concise. ------------------------------------------------------------------------ [2001-10-25 19:42:08] shelby@DownloadFAST.com I did: session_register( "SESSION" ); The following array element is not restored on session_start() of next page: $HTTP_SESSION_VARS["SESSION"]["class_name"] = new ClassName(); Whereas any of the following are restored (each tested independently): $SESSION["class_name"] = new ClassName(); $GLOBALS["SESSION"]["class_name"] = new ClassName(); $HTTP_SESSION_VARS["SESSION"] = new ClassName(); I also have a question which I have not tested. Obviously this question affects whether I can work around this bug with register_globals off. When register_globals is turned off, will $GLOBALS["SESSION"] still represent the same registed session variable? Or am I forced to use $HTTP_SESSION_VARS in that case? The Sessions documentation does not mention $GLOBALS and seems to imply strongly the latter where it says: Quoted from http://www.php.net/manual/en/ref.session.php: "If track_vars is enabled and register_globals is disabled, only members of the global associative array $HTTP_SESSION_VARS can be registered as session variables. The restored session variables will only be available in the array $HTTP_SESSION_VARS." ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13831&edit=1

« previous php.dev (#71573) next »