Page 1 of 1

Why does the session value disappear ?

Posted: Wed Aug 16, 2006 1:42 am
by chu2654
Hello,
I use session as the following. But the session value disappear in main.php. What's the problem ?
$_SESSION["SESSION_TIMESTAMP"] = time();
header("Location:main.php");

Posted: Wed Aug 16, 2006 1:43 am
by RobertGonzalez
Are you calling session_start() at the top of every page that is using the session?

Posted: Wed Aug 16, 2006 8:00 am
by feyd
Sessions setting can be short circuited if you redirect. Try adding a call to session_write_close().