----- Original Message -----
From: Nenad <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 15, 2001 4:58 PM
Subject: Sending Cookies from Access-Handler
> Hallo,
>
> After reading the "Writing Apache Modules .."-book,
> i took the ticketserver code as the foundation for a new Authtentication
Module.
> I want Cookies which have expired to silently "refresh".
>
> so as a test i have code similar to this
>
> package Apache::PermanentTicketRenewer
> my Counter;
> sub handler {
> my $r = shift;
>
> $Counter += 1;
> my $cookie = CGI::Cookie->new(-name => 'Ticket',
> -path => '/',
> -domain => '.my.com',
> -expires => '+1M',
> -value => { 'ID' => $Counter }
> );
>
> $r->warn('setting cookie ',$cookie); # this shows up in the
error_log
> $r->headers_out->add("Set-Cookie" => $cookie);
> i also tried
> $r->err_header_out("Set-Cookie" => $cookie);
> and
> $r->cgi_header_out("Set-Cookie" => $cookie);
> return OK;
> }
>
> and in httpd.conf
> <Location /my_protected >
> PerlSendHeader On
> PerlAccessHandler Apache::TicketAccess
> #PerlAuthzHandler Apache::TicketAccess
> ...
> </Location>
>
>
> And it doesn't work !
> The Browser does not set the new cookie , only the first ever sent cookie
is set.
> Whats wrong with this ?
> As you can see i also tried to use the AutzHandler, but somehow this does
not get called at all.
The reason for that is that there is no 'require' directive in your
configuration. You need something like
require valid-user
in there for it to call AuthHandlers.
Someone correct me if i am mistaken please.
>
> Puzzled,
>
> Nenad
>