php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44324 $_SESSION[0] is not stored
Submitted: 2008-03-04 15:57 UTC Modified: 2008-03-05 01:44 UTC
From: Pasuk2003 at mail dot ru Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.2.5 OS: WIndows XP SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: Pasuk2003 at mail dot ru
New email:
PHP Version: OS:

 

 [2008-03-04 15:57 UTC] Pasuk2003 at mail dot ru
Description:
------------
When using $_SESSION and trying to store there something in key=0, the whole session data is not 'magically' :) present in the next page load

Reproduce code:
---------------
<?php
session_start();
var_export($_SESSION);
$_SESSION[0]=array( ... );
?>

Expected result:
----------------
-- first load:
array()

-- second load
array( 0 => array( ... ) )

Actual result:
--------------
-- first load:
array()

-- second load
array()

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-05 01:44 UTC] felipe@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php



Says the documentation:
"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. For more details see the section on variables in this manual."

http://docs.php.net/manual/en/session.examples.php
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 18:01:32 2025 UTC