Good idea but remember some people turn off javascript and cookies :)

Make your site as accessible as you can, using Jerry's suggestion is a good
idea and then accept some people will be bent on not being able to use your
site by disabling as much functionality in their browsers as they can or
they use old browsers that don't support the functionality you are using.

Jason

-----Original Message-----
From: Jerry [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 16, 2002 10:20 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: sessions: what to do when browser won't accept cookies?

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (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/)

-- 
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