note 12363 deleted from ref.session by yohgaki
| From: | yohgaki@php.net | Date: | Sat, 19 Jan 2002 06:43:13 +0000 |
| Subject: | note 12363 deleted from ref.session by yohgaki | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25116@lists.php.net to get a copy of this message | ||
I noticed that the $HTTP_SESSION_VARS[] array does not get updated until the NEXT PAGE HAS LOADED.
This was not very clear in the above description.
The following script illustrates this point. The value of $myvar and $HTTP_SESSION_VARS[myvar] is
always off by one after the increment:
<?php
session_start();
session_register('myvar');
$myvar++;
# these values will always be off by one
print "myvar=$myvar ";
print "myvar=$HTTP_SESSION_VARS[myvar]";
?>
If you continue to reload the script, you will see that the HTTP_SESSION_VARS is always one behind.