#36536 [Bgs]: Character '|' kill whole sessions
| From: | dave at dgx dot cz | Date: | Tue, 28 Feb 2006 01:28:26 +0000 |
| Subject: | #36536 [Bgs]: Character '|' kill whole sessions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93742@lists.php.net to get a copy of this message | ||
ID: 36536
User updated by: dave at dgx dot cz
Reported By: dave at dgx dot cz
Status: Bogus
Bug Type: Session related
Operating System: *
PHP Version: *
New Comment:
Sorry, my mistake.
http://www.php.net/session says "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..."
Previous Comments:
------------------------------------------------------------------------
[2006-02-26 18:59:21] helly@php.net
.
------------------------------------------------------------------------
[2006-02-26 18:40:03] dave at dgx dot cz
Description:
------------
If any session key contains character '|', the whole session will not
be saved (and will be erased!)
Reproduce code:
---------------
<?php
session_start();
$_SESSION['La'] = 'Trine';
$_SESSION['a|b'] = 'the killer';
session_write_close();
// test
session_start();
var_dump($_SESSION);
?>
Expected result:
----------------
array(2) {
["La"]=>
string(5) "Trine"
["a|b"]=>
string(10) "the killer"
}
Actual result:
--------------
PHP 4.3.9-4.4.2 & 5.0.2-5.1.2
array(0) {
}
PHP 5.0.0-5.0.1 and previous PHP4
array(3) {
["La"]=>
string(5) "Trine"
["a"]=>
NULL
["b"]=>
string(10) "the killer"
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36536&edit=1