UBB.Dev
Posted By: iluvcharlescapps perl and cookies - 04/03/2002 1:38 PM
i need to make a script that will grab the cookie, the whole cookie, and nothing but the cookie...

haven't done much perl for a while and im not sure if you can do it

i need to write it to a file...
Posted By: Dave_L Re: perl and cookies - 04/03/2002 2:34 PM
The easiest way is to use CGI::Cookie .
Posted By: iluvcharlescapps Re: perl and cookies - 04/03/2002 11:06 PM
okay, but how do i use that to grab the WHOLE cookie, not just a single value...

i tried: %cookies = parse CGI::Cookie($ENV{COOKIE});

but im not quite sure if that does it, AND i dont exactly know how to get all the data from that without knowing a value...
Posted By: joking-down Re: perl and cookies - 04/04/2002 1:15 AM
now you can use
[code][/code]to print all values on the screen...
Posted By: Dave_L Re: perl and cookies - 04/04/2002 2:00 AM
1) I'm not sure what you mean by the whole cookie. A cookie provided by a browser consists of a name and a value.

2) You should be able to use the fetch method, rather than the parse method on the environment variable.

3) I believe you need to use the value method to get the cookie's value from the hash value.

[code][/code]
Posted By: Dave_L Re: perl and cookies - 04/04/2002 2:01 AM
duplicate post
© UBB.Developers