PHP not remembering sessions
| From: | IndSys, GE Interlogix) | Date: | Thu, 23 Oct 2003 20:00:57 +0000 |
| Subject: | PHP not remembering sessions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-167337@lists.php.net to get a copy of this message | ||
Hi All,
I have a problem with PHP not remembering sessions. for example:
in page1.php:
<? session_start();
$_SESSION["var"] = "Please help"; ?>
<form action="sessionTest2.php" method=post>
<input type="text" name="loopCount" size="21",
maxlength="20"></td>
<input type="submit" value="Submit"></td>
in page2.php
<? session_start();
echo $_SESSION["var"];
echo $_POST["loopCount"];
?>
what I see above is only data for loopCount. I am not able to see the "Please help" on
page2
I noticed that 2 cookies were created one for each session start. When I opened one of the cookies,
I noticed that the data "Please help" was in the session cookie. Somehow php thinks a
session is not already created and starts a new session on page2.php.
my php.ini file has:
register_globals = off
session.use_cookies = 1
session.use_only_cookies = 1
session.auto_start = 0
session.gc_maxlifetime = 1440
Please can someone help me. I am not sure what I am doing wrong? Maybe it is some configuration that
is causing this issue. Any help appreciated.
Thanks,
moiz