%cookies = fetch CGI::Cookie;
$fn = $cookies{"fn"};
etc..

-----Original Message-----
From: Steve Sotis [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 2:35 PM
To: [EMAIL PROTECTED]
Subject: Cookies revisited


I'm saving cookies like this, which seems to be working fine:


sub     SetCookie
{
my( $fn, $ln, $addr, $city, $state, $zip, $ctry, $phone, $email ) = @_;

$cookie = new CGI::Cookie( -name=>'myInfo',
        -value=> { fn => $fn, ln => $ln, addr => $addr, city => $city, state
=> 
$state, zip => $zip, ctry => $ctry, phone => $phone, email => $email } );

return -cookie=>$cookie;
}       # end SetCookie


The best example I can find to retrieve this cookie is the CGI::Cookie man 
page, which is essentially this:

%cookies = fetch CGI::Cookie;
foreach (keys %cookies) {
        do_something($cookies{$_});
}


Two questions:

1. Is there a way to specify exactly which cookie I want rather than 
iterating through all known cookies?

2. What's an easy way to parse the value string returned from my cookie 
back into the individual elements $fn, $ln, $addr, etc.

Thanks,

Steve


_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to