phooghoudt has asked for the wisdom of the Perl Monks concerning the following question:
Hello ppl, my script makes a session cookie if the client doesn't already have one, but if the client doesn't have cookie support, millions of sesssions will be created everytime the user uses the website, how can I check if cookies are enabled at the browser?
thanks,
p
Re: Checking Cookies Support with Perl
by Kanji (Parson) on Apr 04, 2002 at 20:24 UTC
|
| [reply] |
Re: Checking Cookies Support with Perl
by extremely (Priest) on Apr 04, 2002 at 20:27 UTC
|
Short answer, you can't. People can turn off cookies in every major browser now.
If you must do cookies that way, maybe you can mark the ones that are returned and purge the ones that never get used after a short period?
Alternately, you can do a two stage cookie drop where you send them a "cookie request" cookie and then only make a long term cookie if they have that cookie. But then you have to work out a strategy for url "marking" the people who wouldn't accept the cookie and ignoring them.
--
$you = new YOU;
honk() if $you->love(perl) | [reply] |
|
Of course you can check using the tried and true suck it and see approach. You send them a cookie with a data string like "Hello? Are you listening to me browser? Yeah, I'm talkin' to you Moz" and then see if you can read this back. If yes Thunderbirds are good to go, if not you cookie has evidently evaporated, condemned to float forever in the endless null void of cyberspace, perhaps one day to give sustenance to a lost and lonely, sad and hungry packet sniffer....
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
| [reply] |
|