Re: PHP not remembering sessions
| From: | Chris Shiflett | Date: | Thu, 23 Oct 2003 20:48:32 +0000 |
| Subject: | Re: PHP not remembering sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167357@lists.php.net to get a copy of this message | ||
--- Daniel Guerrier <dan_guerrier@yahoo.com> wrote:
> Use
> $_SESSION['var']
>
> instead of
>
> $_SESSION["var"]
That won't make any difference.
As for the original question, I don't notice any immediate problems with the
code:
> > 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"];
> > ?>
You mentioned seeing "Please help" in a cookie. Are you certain about this? I
don't understand how that can end up in a cookie unless you set the cookie
yourself or there is a serious bug.
Aside from that, it is also worth analyzing exactly what cookies are getting
sent by the browser when it requets page2.php. Can you show us the HTTP for
this particular transaction?
Chris
=====
My Blog
http://shiflett.org/
HTTP Developer's Handbook
http://httphandbook.org/
RAMP Training Courses
http://www.nyphp.org/ramp