note 91759 added to function.session-start
| From: | hperrin at gmail dot com | Date: | Wed, 24 Jun 2009 20:41:16 +0000 |
| Subject: | note 91759 added to function.session-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157439@lists.php.net to get a copy of this message | ||
When using session_start() multiple times in one script, it seems to only maintain $_SESSION
variables with string keys.
<?php
session_start();
$_SESSION[0] = 'this is a test';
$_SESSION[1] = 'this is also a test';
$_SESSION['test0'] = 'this is a test';
$_SESSION['test1'] = 'this is also a test';
session_write_close();
session_start();
echo "Session var 0 = ".$_SESSION[0]."<br />";
echo "Session var 1 = ".$_SESSION[1]."<br />";
echo "Session var 'test0' = ".$_SESSION['test0']."<br
/>";
echo "Session var 'test1' = ".$_SESSION['test1'];
?>
Outputs:
Session var 0 =
Session var 1 =
Session var 'test0' = this is a test
Session var 'test1' = this is also a test
----
Server IP: 208.69.120.35
Probable Submitter: 65.103.100.250
----
Manual Page -- http://www.php.net/manual/en/function.session-start.php
Edit -- https://master.php.net/note/edit/91759
Del: integrated -- https://master.php.net/note/delete/91759/integrated
Del: useless -- https://master.php.net/note/delete/91759/useless
Del: bad code -- https://master.php.net/note/delete/91759/bad+code
Del: spam -- https://master.php.net/note/delete/91759/spam
Del: non-english -- https://master.php.net/note/delete/91759/non-english
Del: in docs -- https://master.php.net/note/delete/91759/in+docs
Del: other reasons-- https://master.php.net/note/delete/91759
Reject -- https://master.php.net/note/reject/91759
Search -- https://master.php.net/manage/user-notes.php