Re: Session variables confusion
| From: | Jon Parise | Date: | Sat, 10 Nov 2001 23:05:15 +0000 |
| Subject: | Re: Session variables confusion | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-70032@lists.php.net to get a copy of this message | ||
On Sun, Nov 11, 2001 at 12:02:56AM +0100, Sebastian Bergmann wrote:
> Environment: Current CVS on Win32.
>
> <?php
> session_register('a');
> session_register('b');
> session_register('c');
>
> echo 'GLOBALS[a]: ' . ++$GLOBALS['a'] .
> '<br>';
> echo '_SESSION[b]: ' . ++$_SESSION['b'] .
> '<br>';
> echo 'HTTP_SESSION_VARS[c]: ' . ++$HTTP_SESSION_VARS['c'] .
> '<br>';
> ?>
>
> register_globals = On -> Only ++$GLOBALS['a'] is effective
> register_globals = Off -> ++$GLOBALS['a'] is not effective, the other
> two work (ie. the numbers increase on sub-
> sequent requests)
>
> At the conference Rasmus told me that the $HTTP_SESSION_VARS array
> should work in _both_ situations. Is this broken, or intended? I'm
> confused right now - which is a no so uncommon situation nowadays :-)
What about $GLOBALS['HTTP_SESSION_VARS']['a']?
--
Jon Parise (jon@csh.rit.edu) . Information Technology (2001)
http://www.csh.rit.edu/~jon/ : Computer Science House
Member