note 58707 added to function.session-start
| From: | kinns at 126 dot com | Date: | Sun, 13 Nov 2005 08:59:10 +0000 |
| Subject: | note 58707 added to function.session-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-98498@lists.php.net to get a copy of this message | ||
Why session can't pass to another page?(use php 4.4.0)
I wrote two php pages:
1.php
<?
session_start();
$_SESSION["login"] = true;
$_SESSION["admin"] = "name";
echo "<a href=\"2.php\" target=\"_blank\">2.php</a>";
?>
2.php
<?
session_start();
var_dump($_SESSION);
?>
i access 2.php through 1.php , but it outputs: array(0){}
Why ?
i have tried many times .
but sometimes it works as i want
but more times it doesn't work!
----
Manual Page -- http://www.php.net/manual/en/function.session-start.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58707
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58707&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58707&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58707&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58707&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58707&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58707&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58707&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58707&report=yes
Search -- http://master.php.net/manage/user-notes.php