This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.
To: Rodney Broom <rbroom@Desert.NET> From: Doug MacEachern <dougm@covalent.net> Subject: Re: Apache::Cookie->fetch fails silently Date: Tue, 19 Jun 2001 09:41:14 -0700 (PDT) On Fri, 15 Jun 2001, Rodney Broom wrote: > I've got this handler that calls Apache::Cookie->fetch, no problem. It's > tested and works fine. So I installed the same handler (same machine) on > a second Apache instance, but now Apache::Cookie->fetch fails, causing > the handler to terminate. No messages, no nothin'. It doesn't even get > to the next print() statement after the fetch() call. try Apache::Cookie->new($r)->parse; Apache::Cookie->fetch uses the global request_rec which might not be setup yet, depending on what phase you're in. you could also set it up yourself first: Apache->request($r); Apache::Cookie->fetch; === To: mod_perl Users List <modperl@apache.org> From: Alexei Danchenkov <danchenkov@comail.ru> Subject: libapreq. Apache::Cookie returns different 'expires' than CGI::Cookie? Date: Fri, 14 Dec 2001 20:15:25 +0300 Hello, All! I wonder why my '$cookie->expires' for this code returns a different result than the similar one with CGI::Cookie (commented). The result is different in a way that some additional binary code is being added to the expiry date. $cookie = Apache::Cookie->new( $r, -name=>"access", -value=>$value, -expires=>"+10m" ); # my $cookie = new CGI::Cookie( -name=>"access", -value=>$value, -expires=>"+10m" ); $expiry = $cookie->expires; Any suggestions? Cheers, Alexei mailto:danchenkov@comail.ru === To: mod_perl Users List <modperl@apache.org> From: Alexei Danchenkov <danchenkov@comail.ru> Subject: Re: libapreq. Apache::Cookie returns different 'expires' than CGI::Cookie? Date: Tue, 18 Dec 2001 18:27:38 +0300 Hello, darren, Friday, December 14, 2001, 9:39:46 PM, you wrote: dc> Alexei Danchenkov <danchenkov@comail.ru> said something to this effect on 12/14/2001: >> Hello, All! >> I wonder why my '$cookie->expires' for this code returns a >> different result than the similar one with CGI::Cookie >> (commented). The result is different in a way that some >> additional binary code is being added to the expiry date. >> >> $cookie = Apache::Cookie->new( $r, >> -name=>"access", >> -value=>$value, >> -expires=>"+10m" ); >> >> # my $cookie = new CGI::Cookie( >> -name=>"access", >> -value=>$value, >> -expires=>"+10m" ); >> >> $expiry = $cookie->expires; >> >> Any suggestions? dc> Maybe I'm just slow, but I can see the difference between the dc> two. Can you elaborate? dc> (darren) The only apparent difference that I see is that Apache::Cookie->new requires $r to be sent to it as a first parameter, where CGI::Cookie does not. Per the Apache::Cookie manpage, that should lead to the same result, but does not in my case. The cookie does not disappear. The expiry property however, gets changed and then the $cookie->bake (or $r->err_headers_out->add( "Set-Cookie" => $cookie->as_string )), which should add 'Set-cookie' to the header does not work. Here is an example of what Apache::Cookie->new returns: c