note 60409 added to function.session-start
| From: | martinlarsen at bigfoot dot com | Date: | Fri, 06 Jan 2006 00:07:11 +0000 |
| Subject: | note 60409 added to function.session-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101282@lists.php.net to get a copy of this message | ||
Here is another way of losing session variables (not complete sessions):
I kept loosing *some* session variables controlling logins, but most of the session vars stayed
intact. After nearly going crazy, I discovered that the web host had register_globals ON.
That meant that each time I assigned a variable with the same name as a session variable, the
session variable changed too!
For example:
$_SESSION['id'] = 100;
$id = 0;
echo $_SESSION['id'];
// This prints 0, not 100!
If some of your session vars dissappear or change mysteriously, look out for register_globals = ON
!!!
----
Manual Page -- http://www.php.net/manual/en/function.session-start.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60409
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60409&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60409&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60409&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60409&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60409&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60409&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60409&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60409&report=yes
Search -- http://master.php.net/manage/user-notes.php