RE: [PHP] PHP not remembering sessions
| From: | IndSys, GE Interlogix) | Date: | Thu, 23 Oct 2003 20:10:38 +0000 |
| Subject: | RE: [PHP] PHP not remembering sessions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-167342@lists.php.net to get a copy of this message | ||
It seems that there is a problem with the session management on windows/apache. I was surfing the
web to find an answer, and I noticed that there are couple of other people who have the same
problem. But alas, there were no answers posted to this problem. So someone, please help me if you
know why this is happening.
Thanks
Moiz
-----Original Message-----
From: Daniel Guerrier [mailto:dan_guerrier@yahoo.com]
Sent: Thursday, October 23, 2003 4:04 PM
To: Golawala, Moiz M (IndSys, GE Interlogix); php-general@lists.php.net
Subject: Re: [PHP] PHP not remembering sessions
Use
$_SESSION['var']
instead of
$_SESSION["var"]
--- "Golawala, Moiz M (IndSys, GE Interlogix)"
<Moiz.Golawala@ge.com> wrote:
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com