jebusCL has asked for the wisdom of the Perl Monks concerning the following question:
where could be the problem?? thanks in advancesub setCookie { my ($expires, @cookies) = @_; my ($header); my ($cookie,$value, $char); my @cookie_encode_chars = ('\%', '\+', '\;', '\,', '\=', '\&', '\:\:', + '\s'); my %cookie_encode_chars = ('\%','%25','\+','%2B','\;','%3B','\,','%2C' +,'\=', '%3D','\&','%26','\:\:','%3A%3A','\s','+'); my @cookie_decode_chars = ('\+', '\%3A\%3A', '\%26', '\%3D', '\%2C', ' +\%3B', '\%2B', '\%25'); my %cookie_decode_chars = ('\+',' ','\%3A\%3A', '::','\%26','&','\%3D' +,'=','\%2C', ',','\%3B',';','\%2B','+','\%25','%'); while(($cookie,$value)=@cookies) { foreach $char (@cookie_encode_chars) { $cookie =~ s/$char/$cookie_encode_chars{$char}/g; $value=~ s/$char/$cookie_encode_chars{$char}/g; } if ( $expires) { $header.= "Set-Cookie: $cookie=$value; expires = $expires; path=/;\n"; } shift(@cookies); shift(@cookies); } $cookie =1; return $header; } sub GetCook { my (@cookies, %cookie_hash, $cookie, $key, $val); @cookies = split (/; /,$ENV{'HTTP_COOKIE'}); foreach $cookie (@cookies) { ($key, $val) = split (/=/,$cookie); $cookie_hash{$key} = $val; } return keys(%cookie_hash); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl + IE + Cookies
by dragonchild (Archbishop) on Dec 06, 2004 at 15:15 UTC | |
Re: Perl + IE + Cookies
by csuhockey3 (Curate) on Dec 06, 2004 at 19:46 UTC |