Re: session lost when back button hit?

From: Date: Sat, 17 Aug 2002 06:01:42 +0000
Subject: Re: session lost when back button hit?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-113059@lists.php.net to get a copy of this message
Alok K. Dhir wrote:
By any chance, is page one the "entrance" page to your application?
Yes.
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?
Nope. Is the is the entrance so there is no nothing passed to it. Users just enter the URL in the location bar, for example, and come in.
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.
Really? I just turned cookies and javascript off and then visited Amazon.com. I added an item to my cart, hit the back buttonall way back to the entrance and then checked my cart ... lo-and-behold the item was in my cart still. How did they do that?
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.
Ok. Can you explain this in more detail? I understand the concept you are suggesting but I can't picture how to do this in PHP. Thanks for the info! Jc

« previous php.general (#113059) next »