Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: reading and writing a CGI cookie in the same page

by PodMaster (Abbot)
on Feb 21, 2003 at 02:20 UTC ( [id://237316]=note: print w/replies, xml ) Need Help??


in reply to Re: reading and writing a CGI cookie in the same page
in thread reading and writing a CGI cookie in the same page

Forget javascript trickery (as a "helper" javascript rocks, but you can't rely on it so don't rely on it from the beginning).

It is best to do a redirect (some might call it standard practice). See merlyns article on Basic Cookie Management.

Basic strategy is

  • user visits foo.cgi
  • you try to set a cookie whilst redirecting to foo.cgi?redirect=1
  • if you can read cookie, do your thing, if not, user don't support cookies, so don't redirect again (redirect=1 to prevent an infinite loop)


MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
** The Third rule of perl club is a statement of fact: pod is sexy.

  • Comment on Re: Re: reading and writing a CGI cookie in the same page

Log In?
Username:
Password:

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

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

    No recent polls found