Re: Sessions and register_globals
| From: | Rasmus Lerdorf | Date: | Fri, 05 Oct 2001 15:48:28 +0000 |
| Subject: | Re: Sessions and register_globals | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-67352@lists.php.net to get a copy of this message | ||
This is expected behaviour as far as I am concerned. When
register_globals is off the $session[] array is completely separate from
$HTTP_SESSION_VARS['session'] so doing a session_register('session') is
replacing the existing registered variable with this completely new one.
-Rasmus
On Fri, 5 Oct 2001, Sebastian Bergmann wrote:
> I just noticed the following with PHP 4.0.8-dev, built from CVS today:
>
> When register_globals is enabled, this script
>
> <?php
> session_register('session');
> $session[] = time();
> ?>
> <pre>
> <?php
> echo session_id().'<br>';
> print_r($session);
> ?>
>
> outputs an array that grows with each request to the script.
>
> When register_globals is disabled, it only outputs the timestamp of
> the current request.
>
> Since the displayed session_id does not change between requests, it
> is not the session itself that 'gets lost' when register_globals is
> disabled, but 'only' the variables contents.
>
> Now: Is this intended behaviour and I just never happened to notice it
> since I disabled register_globals for the first time today, or is
> this a bug?
>
>