session lost problem
| From: | bug zhu | Date: | Tue, 24 Apr 2012 04:58:11 +0000 |
| Subject: | session lost problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-317655@lists.php.net to get a copy of this message | ||
hi all:
there are tow php files a.php and b.php,
content of a.php as follows:
<?php
session_start();
if (!isset($_GET['flag']))
{
header('Location: b.php');
}
else
{
var_dump($_SESSION);
}
content of b.php as follows:
<?php
session_start();
session_commit();
$_SESSION['test'] = 'test';
session_commit();
header('Location: a.php?flag=1');
when i visit a.php, the dumped $_SESSION array is empty
but if i commented the first session_commit() in b.php and then visit
a.php, i cound see the $_SESSION array,which is not empty
i wish i have descibed clear about my problem and someone could give me a
feedback~
--
thanks,
bugzhu