Re: sessions: what to do when browser won't accept cookies?
| From: | Jerry | Date: | Fri, 16 Aug 2002 16:19:33 +0000 |
| Subject: | Re: sessions: what to do when browser won't accept cookies? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112981@lists.php.net to get a copy of this message | ||
In article <3D5D14EB.5040505@myrealbox.com>,
jean_christian@myrealbox.com (Jean-Christian Imbeault) wrote:
> How can I get around the problem of not having the SID in the URL of the
> first page to my site the user comes to? It kind of a chicken-or-the-egg
> problem ...
I kind of hate it when sites do this, but you could have the first page
reload itself if it doesn't have an SID, and add an SID to itself. This
way, if they use the back button, the first "first page" they come to
has the SID.
You might then be able to use window.forward() in Javascript first,
before giving them an SID. If they used the back button to get to you,
window.forward() moves forward to a page that has an SID (which should
look exactly like the page they thought they wanted that didn't have an
SID). If they didn't use the back button to get to you, window.forward
shouldn't do anything.
As a fall-back, you would probably want to have a warning on the front
page that says, if the front page has no SID, that if they used the back
button get here, use the forward button to go back or they might lose
their session data.
This depends on your audience, of course. If you did that to me as a
general browser, I probably wouldn't ever visit your site again :*)
Note that some sites do come right out and tell you not to use your back
button to get around. You might just do this, and if they use their back
button anyway, they get a new session.
Jerry
--
http://www.hoboes.com/jerry/
"Give a man a fish and you feed him for a day. Teach him to fish, and you've
depleted the lake."--It Isn't Murder If They're Yankees
(http://www.hoboes.com/jerry/Murder/)