Perl CGI Cookies

rich2kchan
06-30-2002, 09:51 PM
Anyone know of a way to retrieve or create cookies on the client's comp using perl cgi?

Flyguy
07-01-2002, 02:54 AM
Perl is server side scripting, a cookie is on the client side.
So you would have to retrieve the cookie using javascript and pass it to a cgi script.

Robby
07-01-2002, 11:36 AM
Perl allows reading/writing cookies, I'll look through my old code. (later today)

Flyguy
07-01-2002, 12:40 PM
Yup you are right. After some talking on IRC I found those two links
1. Explanation of Set-Cookie: http://wp.netscape.com/newsref/std/cookie_spec.html
2. Using it with Perl: http://www.xav.com/perl/site/lib/HTTP/Cookies.html

Derek Stone
07-01-2002, 06:24 PM
a cookie is on the client side

A cookie can be on both sides, sent back and forth via HTTP headers. This is how ASP handles it.

-CL

Flyguy
07-02-2002, 03:15 AM
CL, I already posted I was wrong, but the original question is about cookies on the CLIENT side.

Anyone know of a way to retrieve or create cookies on the client's comp using perl cgi?

Robby
07-02-2002, 10:08 AM
try this ...

//use CGI;

// $cgi = new CGI;

$cookie = $cgi->cookie(-name=>'someCategory', -value=> \%someValue, -expires=>'1Y');
print $cgi->header(-cookie=>$cookie);

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum