AuthDBI log out is it possible

J

joe

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

Joost Diepenmaat

joe said:
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.
 
J

joe

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
 
J

J. Gleixner

joe said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,244
Latest member
cryptotaxsoftware12

Latest Threads

Top