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.

Puzzled,

Nenad

Reply via email to