note 43642 deleted from function.session-is-registered by philip
| From: | philip@php.net | Date: | Sun, 04 Mar 2007 00:21:52 +0000 |
| Subject: | note 43642 deleted from function.session-is-registered by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-124054@lists.php.net to get a copy of this message | ||
Note Submitter: steve at fakesterdesigns com
----
since it seems a little tedious to use $_SESSION['var'] all over my code, I just make a
reference at the start of my page and use the simple reference name thereafter.
<?
session_start();
$myName = &$_SESSION['myName'];
echo($myName);
?>
This is, of course, only a reference and not a copy. So if you change the local variable, It'll
be changed in the $_SESSION global array as well. This could be good or bad, so just be aware of
what you're doing.