RE: [PHP] SESSION problem
| From: | tedd | Date: | Wed, 20 Aug 2008 14:17:34 +0000 |
| Subject: | RE: [PHP] SESSION problem | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-278396@lists.php.net to get a copy of this message | ||
At 12:55 AM +0100 8/20/08, Ford, Mike wrote:
Content-Type: text/plain Content-length: 1998 Been on holiday, so coming to this party a bit late, but.... On Sat 16/08/2008 15:06 Stut wrote:Yeah, but that's no fair -- you read the documentation. :-) Seriously, however, the thing that bothered me wasn't the limitations in keys, that's understandable, but rather if you do use a numeric index, then all the legal session variables declared after that incident no longer work. Imagine having ten session variables working and then adding another with a numeric index between sessions five and six declarations. I can see the session with the numeric index not working, but why would sessions six through ten stop? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.comOn 16 Aug 2008, at 14:46, tedd wrote:At 2:11 PM +0100 8/16/08, Stut wrote:Well at http://www.php.net/manual/en/session.examples.php there's a big fat Note at the top of the page which includes the following: "The keys in the $_SESSION associative array are subject to the same limitations as regular variable names in PHP, i.e. they cannot start with a number and must start with a letter or underscore.".Ahh, I see the problem. You've never been able to use numbers as keys at the root level of the $_SESSION array. It's not a bug, it's just the way it is. I've just checked the documentation and can't find an obvious reference to this limitation which is kinda annoying.