You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Hill, Ronald" <ro...@plms-eds.com> on 2003/03/04 15:42:44 UTC

AuthCookie with a modified version of Authticket unable to delete the cookie (logout)

Hi All,

I am having problems using Authcookie 3.0 and a modified version of
AuthTicket 0.31
The problem is that I am not able to log off (delete the cookie). This is 
frustrating :-(

I have everything else working correctly. Here is what I have done:

In my http.conf file I have defined the appropriate directives:
PerlModule Apache::AuthCookie
    PerlModule Apache::PLMSolutions
    PerlSetVar Apache::PLMSolutions /
    PerlSetVar PLMSolutionsLoginScript /PLMSolutionsloginform
    PerlSetVar PLMSolutionsLogoutScript /PLMSolutionslogout
    PerlSetVar PLMSolutionsTicketLoginHandler /PLMSolutionslogin
    PerlSetVar PLMSolutionsLoginScript /PLMSolutionsloginform
    PerlSetVar AuthCookieDebug 3

   <Location /cgi-bin/uganswer/bin/>
      AuthType Apache::PLMSolutions
      AuthName PLMSolutions
      PerlAuthenHandler Apache::PLMSolutions->authenticate
      PerlAuthzHandler Apache::PLMSolutions->authorize
      require valid-user
   </Location>

   <Location /PLMSolutionsloginform>
     AuthType Apache::PLMSolutions
     AuthName PLMSolutions
     SetHandler perl-script
     Perlhandler Apache::PLMSolutions->login_screen
   </Location>

   <Location /PLMSolutionslogin>
     AuthType Apache::PLMSolutions
     AuthName PLMSolutions
     SetHandler perl-script
     PerlHandler Apache::PLMSolutions->login
   </Location>

   <Location /PLMSolutionslogout>
     AuthType Apache::PLMSolutions
     AuthName PLMSolutions
     SetHandler perl-script
     PerlHandler Apache::PLMSolutions->logout
   </Location>

Ok, I have created a PLMSolutions.pm module located in
perl5.8.0/lib/site_perl/5.8.0/Apache
directory with this logout function defined as follows:
sub logout    {

    my ($class, $r) = @_;

    my $this = $class->new($r);

    $this->SUPER::logout($r);
    $r->err_headers_out->add('Location' => $this->{TicketLogoutURI});

  return REDIRECT;
} 
On my HTML form I have defined the logout as this:
<FONT size=+1 color="#3C3CFF">
<INPUT type=submit name="function" value="logout"
action="/PLMSolutionslogout">
</FONT>
</FORM>

In the apache error_log file I have this listed:

Tue Mar  4 06:29:51 2003] [error] uri /cgi-bin/uganswer/bin/new_uga.cgi
[Tue Mar  4 06:29:52 2003] PerlHandler subroutine
`Apache::PLMSolutions->login_screen': returning [/PLMSolutionslogin] for
TicketL
oginHandler at /app/perl5.8.0/lib/site_perl/5.8.0/Apache/PLMSolutions.pm
line 140.
[Tue Mar  4 06:29:52 2003] [error] REASON FOR AUTH NEEDED: no_cookie
[Tue Mar  4 06:29:52 2003] [error] AUTHTICKET REASON:
[Tue Mar  4 06:30:01 2003] [error] credential_0 hillr
[Tue Mar  4 06:30:01 2003] [error] credential_1 br3828
[Tue Mar  4 06:30:01 2003] [error] ses_key hillr:Ron Hill
[Tue Mar  4 06:30:01 2003] [error] auth_type Apache::PLMSolutions
[Tue Mar  4 06:30:01 2003] [error] auth_name PLMSolutions
[Tue Mar  4 06:30:01 2003] [error] ses_key_cookie hillr:Ron Hill
[Tue Mar  4 06:30:01 2003] [error] uri /cgi-bin/uganswer/bin/new_uga.cgi
[Tue Mar  4 06:30:01 2003] [error] user authenticated as hillr
[Tue Mar  4 06:30:01 2003] [error] requirement := valid-user,
[Tue Mar  4 06:30:07 2003] [error] auth_type Apache::PLMSolutions
[Tue Mar  4 06:30:07 2003] [error] auth_name PLMSolutions
[Tue Mar  4 06:30:07 2003] [error] ses_key_cookie hillr:Ron Hill
[Tue Mar  4 06:30:07 2003] [error] uri /cgi-bin/uganswer/bin/new_uga.cgi
[Tue Mar  4 06:30:07 2003] [error] user authenticated as hillr
[Tue Mar  4 06:30:07 2003] [error] requirement := valid-user,


Wherever I click the logout button on my form the script just returnes me
to the currect screen I was expecting to go to www-gtac (since that is what
I have defined in the TicketLogoutURI ).
Can someone point out what I am doing wrong? (and how to fix it).
One other question, how can I change the name of the cookie? 
(currently is is Apache::PLMSolutions_PLMSolutions)

Thanks for any help you can provide.

Ron Hill