RE: [PHP] Re: sessions: what to do when browser won't accept cook ies?
| From: | Non-HP-Boise,ex1) | Date: | Fri, 16 Aug 2002 17:03:19 +0000 |
| Subject: | RE: [PHP] Re: sessions: what to do when browser won't accept cook ies? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-112988@lists.php.net to get a copy of this message | ||
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:jerry@acusd.edu]
Sent: Friday, August 16, 2002 10:20 AM
To: php-general@lists.php.net
Subject: [PHP] Re: sessions: what to do when browser won't accept cookies?
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/)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php