note 30489 added to ref.session

From: Date: Wed, 19 Mar 2003 20:10:10 +0000
Subject: note 30489 added to ref.session
Groups: php.notes 
Request: Send a blank email to php-notes+get-45529@lists.php.net to get a copy of this message
Do not 'global' a superglobal! If you register a $_SUPERGLOBAL as a global variable (as in... global $_SESSION; within a function definition) strange things happen with some versions of PHP (PHP 4.2.3 on my MacOS X powerbook, but not my PHP 4.2.3 RH 7.3 linux machine). In the case I found, $_SESSION and $HTTP_SESSION_VARS would not reference the same data, and unsetting or accessing the data was inconsistant. Didn't test very far, but obviously this should not be done, and it did wreck havoc for me. -- http://www.php.net/manual/en/ref.session.php http://master.php.net/manage/user-notes.php?action=edit+30489 http://master.php.net/manage/user-notes.php?action=delete+30489 http://master.php.net/manage/user-notes.php?action=reject+30489

« previous php.notes (#45529) next »