Sessions and register_globals
| From: | Sebastian Bergmann | Date: | Fri, 05 Oct 2001 15:39:03 +0000 |
| Subject: | Sessions and register_globals | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-67349@lists.php.net to get a copy of this message | ||
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?
--
Sebastian Bergmann
http://sebastian-bergmann.de/ http://phpOpenTracker.de/
Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/