At 2:40 PM +0100 1/8/02, Zsolt Czinkos wrote: > >------- >Here's my simple script: > >package SetMyCookies; > >use Apache; >use Apache::Constants; >use Apache::Cookie();
Very important to use strict when writing anything in mod_perl. >sub handler { > >my $r = shift; > > $c = $r->header_in("Cookie"); $c is going to persist across multiple connections without my(). > local(@rawCookies) = split (/; /,$c); > local(%cookies); Use my()... my() is more appropriate in this case. Always reset %cookies = (); # just in case > foreach(@rawCookies){ > ($key, $val) = split (/=/,$_); > $cookies{$key} = $val; > } > be sure to my() $key and $val > foreach $name (keys %cookies) { > print STDERR "$name = $cookies{$name}\n"; > } My() $name. > my $cookie = Apache::Cookie->new($r, > -name => 'lofos', > -value => 'lofos13', > -expires=> '+24M', > -path => '/' > ); > > $r->header_out("Set-Cookie",$cookie->as_string); > > return OK; >} >1; > >--------------- >And here's the error_log on one request: More importantly, check your access log. Something like a nimda in association with the above code might produce multiple lines in your error log like this. >kakukk = kukka234534 >kakukk = kukka234534 >kakukk = kukka234534 >kakukk = kukka234534 Good luck, Rob -- When I used a Mac, they laughed because I had no command prompt. When I used Linux, they laughed because I had no GUI.