AuthDBI log out is it possible

Hello I am using AuthDBI in my apache server, is there a way to code a
log out button? thanks.
joe [ Fr, 18 Januar 2008 19:24 ] [ ID #1911682 ]

Re: AuthDBI log out is it possible

joe <jcharth [at] gmail.com> writes:

> Hello I am using AuthDBI in my apache server, is there a way to code a
> log out button? thanks.

/As far as I know/ you can't force a log out from basic authentication
from the server. Clients will usually remember the login credentials
until they're restarted.

Joost.
Joost Diepenmaat [ Fr, 18 Januar 2008 20:06 ] [ ID #1911685 ]

Re: AuthDBI log out is it possible

Thanks Joost. I guess there is no way to log out. I tried a few php
authentication script with no luck. Now I was asked if it possible to
have a session life. I did not find any settings for this in the
AuthDBI.pm file and suggestions? Thanks

On Jan 18, 2:06 pm, Joost Diepenmaat <jo... [at] zeekat.nl> wrote:
> joe <jcha... [at] gmail.com> writes:
> > Hello I am using AuthDBI in my apache server, is there a way to code a
> > log out button? thanks.
>
> /As far as I know/ you can't force a log out from basic authentication
> from the server. Clients will usually remember the login credentials
> until they're restarted.
>
> Joost.
joe [ Di, 22 Januar 2008 19:04 ] [ ID #1914098 ]

Re: AuthDBI log out is it possible

joe wrote:
> Thanks Joost. I guess there is no way to log out. I tried a few php
> authentication script with no luck.

Please don't top post.

You might be able to force the "logout" by sending a 401 Unauthorized
header. Here's what I've used in the past.


sub unauth_header
{
my $realm = shift;

print "HTTP/1.0 401 Unauthorized\n";
print "401 Unauthorized\n";
print "WWW-Authenticate: Basic realm=\"$realm\"\n\n";
}

> Now I was asked if it possible to
> have a session life. I did not find any settings for this in the
> AuthDBI.pm file and suggestions? Thanks

Sure, you could store the date/time it expires and check it, or
have something else that removes the session after X
minutes/days, however you do have to use sessions first, which
isn't part of AuthDBI. You could either write your own or
use one of the many session modules available from CPAN.
glex_no-spam [ Di, 22 Januar 2008 19:29 ] [ ID #1914100 ]
Perl » comp.lang.perl.misc » AuthDBI log out is it possible

Vorheriges Thema: FAQ 8.46 What's the difference between require and use?
Nächstes Thema: little problem with xml::dom::parser