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: 
> [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]
> .net] On Behalf Of Jean-Christian Imbeault
> Sent: Friday, August 16, 2002 10:43 AM
> To: [EMAIL PROTECTED]
> 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
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to