RE: [PHP] session lost when back button hit?
| From: | Alok K. Dhir | Date: | Fri, 16 Aug 2002 17:03:52 +0000 |
| Subject: | RE: [PHP] session lost when back button hit? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112989@lists.php.net to get a copy of this message | ||
By any chance, is page one the "entrance" page to your application?
I.e. is there a session id in either the query string of the page URL or
was there one passed to it via a POST?
Without cookies enabled, there is no way to allow users to use the back
button to go back to the entrance page while maintaining the session.
One (hackish) solution to this is to cause the entrance page to
immediately redirect to itself using either PHP's header function, or a
meta refresh. Your goal here is to make it so that hitting back from a
secondary page would take you to the post-refreshed entrance page which
has the session ID.
Good luck.
> -----Original Message-----
> From:
> php-general-return-112965-adhir=govshops.com@lists.php.net
> [mailto:php-general-return-112965-adhir=govshops.com@lists.php
> .net] On Behalf Of Jean-Christian Imbeault
> Sent: Friday, August 16, 2002 10:43 AM
> To: php-general@lists.php.net
> Subject: [PHP] session lost when back button hit?
>
>
> I have two pages, page one links to page two via a form button. The
> browser does not accept cookies.
>
> On page two I create a session variable with:
>
> $_SESSION["id"] = 1;
>
> But if I hit the back button to go back to page one
> $_SESSION["id"] is
> not set. If I hit the reload button on page one it is still not set.
>
> How can I get a session var to stay set when someone hits the
> back button?
>
> Jc
>
> PS I have session.auto_start ON and enabled trans-sid
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>