in reply to Re: Cookies without using CGI.pm
in thread Cookies without using CGI.pm
where the Cookies hash returned contains the cookiessub GetCookies { %decode = ('\+'=>' ','\%3A\%3A'=>'::','\%26'=>'&','\%3D'=>'=', '\%2C'=>',','\%3B'=>';','\%2B'=>'+','\%25'=>'%'); my %Cookies = (); foreach (split(/; /,$ENV{'HTTP_COOKIE'})) { my ($cookie,$value) = split(/=/); foreach $ch ('\+','\%3A\%3A','\%26','\%3D','\%2C','\%3B','\%2B','\ +%25') { $cookie =~ s/$ch/$decode{$ch}/g; $value =~ s/$ch/$decode{$ch}/g; } $Cookies{$cookie} = $value; } return %Cookies; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Retrieving cookies without CGI.pm
by Beatnik (Parson) on Jul 25, 2001 at 00:09 UTC |