Re: Re: Sessions still do not persist
| From: | Torsten Roehr | Date: | Fri, 21 May 2004 19:12:02 +0000 |
| Subject: | Re: Re: Sessions still do not persist | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-186709@lists.php.net to get a copy of this message | ||
"Michael R. Wayne" <phpuser@wayne47.com> wrote in message
news:20040521190232.GK92746@manor.msen.com...
> On Fri, May 21, 2004 at 08:35:37PM +0200, Torsten Roehr wrote:
> > Sorry, I'm an idiot! The ? was missing:
> >
> > <form method="post" action="xxx.php?<?= SID; ?>">
> >
>
> Well, I spoke too soon. It does work, but only the SECOND time the
> script is run!
>
> Stage:0 SessionID: 6c9a1819fe95fa6f08f385ee2afa71ca
> ______ [Submit]
> Stage:1 SessionID: 6c9a1819fe95fa6f08f385ee2afa71ca Request: Array ( )
> Type "foo" into the form, hit submit and the session variable is not being
> preserved:
> Stage:0 SessionID: ac429ad0086eb5b4d1130eb2e2fddcb9
> foo___ [Submit]
> Stage:1 SessionID: ac429ad0086eb5b4d1130eb2e2fddcb9 Request: Array
[PHPSESSID] => 6c9a1819fe95fa6f08f385ee2afa71ca [field] => foo )
> Type "bar" into the form, hit submit and the session variable
> IS being preserved:
> Stage:1 SessionID: ac429ad0086eb5b4d1130eb2e2fddcb9
> bar___ [Submit]
> Stage:1 SessionID: ac429ad0086eb5b4d1130eb2e2fddcb9 Request: Array
[PHPSESSID] => ac429ad0086eb5b4d1130eb2e2fddcb9 [field] => bar )
>
> So, what am I missing here?
You could try it without session.auto_start. Turn it off and put
session_start() at the top of the script (in all pages).
Regards, Torsten