note 52935 deleted from ref.session by bjori
| From: | bjori@php.net | Date: | Sat, 30 Dec 2006 16:41:15 +0000 |
| Subject: | note 52935 deleted from ref.session by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121101@lists.php.net to get a copy of this message | ||
Note Submitter: Carlos Aya
----
An bug of my own zoo that was hard to catch with sessions.
This may save time to someone else:
// in some page, after session_start
$_SESSION[$var] = $someValue;
// my bug: $var was wrong, as it didn't contain a valid PHP identifier.
$_SESSION['flag'] = 'here'; // flag is a valid PHP identifier... but...
// then redirect to another page with session_id and everything else ok
. . .
// in next page after session_start()
count($_SESSION) == 0
// ! yes, it's empty, as $var was wrong, that stoped the whole
// $_SESSION array to be stored
hope this saves time to others.