note 53683 deleted from function.session-register by philip

From: Date: Wed, 29 Mar 2006 06:26:46 +0000
Subject: note 53683 deleted from function.session-register by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-106920@lists.php.net to get a copy of this message
Note Submitter: David B. ---- Note that with the existence of both $_SESSION and references, it is not necessary to use register_globals() if you don't want your code cluttered up with references to the $_SESSION superglobal. Just do something like: $_SESSION['some_variable'] =& $GLOBALS['some_variable']; And henceforth you can just use $some_variable and forget all about typing $_SESSION all the time. Though on subsequent sessions if you want to get at that value with a global variable in a similar fashion, you'll of course have to use: $GLOBALS['some_variable'] =& $_SESSION['some_variable']; It's fairly easy to take that knowledge and come up with a user-defined function that does 90+% of what the old session_register() did...

« previous php.notes (#106920) next »