Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
The stupid question is the question not asked
 
PerlMonks  

RE: Re: Recommended modules for handling cookies?

by btrott (Parson)
on Mar 29, 2000 at 02:49 UTC ( #6384=note: print w/ replies, xml ) Need Help??


in reply to Re: Recommended modules for handling cookies?
in thread Recommended modules for handling cookies?

Just try using "sub.domain.com" as the domain. If that's what your domain always is (ie. you don't have other domains like "foo.domain.com" that you want to set the same cookie for), just use that.

And it's "HTTP_COOKIE", not "HTTP-COOKIE". It's an underscore ("_").

And, finally, you really should be using CGI::Cookie. From the docs:

To set cookies:

# Create new cookies and send them $cookie1 = new CGI::Cookie(-name=>'ID',-value=>123456); print header(-cookie=>[$cookie1]);
To fetch cookies:
%cookies = fetch CGI::Cookie; $id = $cookies{'ID'}->value;
Read the documentation for more info, particularly on setting the domain (look at the code setantae posted).


Comment on RE: Re: Recommended modules for handling cookies?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-04-20 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls