Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I don't have a lot of experience with perl, but I'm sure there's an easier way to retrieve a cookie value. The code above is used to retrieve a cookie named user. Then I need to retrieve the value from that cookie named username. Unfortunately the only way I know how to do this is by splitting the $isset variable. Any suggestions?use CGI::Cookie; %cookies = fetch CGI::Cookie; my $isset = $cookies{'user'}; my @temp1 = split(/\;/, $isset); my @temp2 = split(/=/, $temp1[0]); my $username = $temp2[1];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: retrieving cookies with CGI::Cookie
by ikegami (Patriarch) on Sep 25, 2005 at 04:46 UTC | |
|
Re: retrieving cookies with CGI::Cookie
by nedals (Deacon) on Sep 25, 2005 at 14:56 UTC |