Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Checking Cookies Support with Perl

by phooghoudt (Initiate)
on Apr 04, 2002 at 20:20 UTC ( [id://156754]=perlquestion: print w/replies, xml ) Need Help??

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

Replies are listed 'Best First'.
Re: Checking Cookies Support with Perl
by Kanji (Parson) on Apr 04, 2002 at 20:24 UTC
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)

      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://156754]
Approved by rob_au
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-20 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found