.htaccess Logout

M

Matthieu Ebert

Hi ,

how can I , as a Site User (Visitor) when i loged in with .htaccess logout
myself again without closing my browser. Do you know any solutions in PHP ,
send a Header or something.

Cheers
Matt.
 
R

Rob McAninch

Matthieu Ebert>:
how can I , as a Site User (Visitor) when i loged in with .htaccess logout
myself again without closing my browser. Do you know any solutions in PHP ,
send a Header or something.

Is this a site you want to give users the ability to logout from, or
do you want to logout from someone else's site?

You can't control someone else's site, so just close your browser.
Or perhaps your browser has an option to forget authentication
information.

If this is your site you want the feature for. Try
http://www.php.net/features.http-auth

But you may be better off using a more robust login method than
basic authentication. Typically these involve cookies with a session
id that times out.
 
M

Matthieu Ebert

No No ,

i want that:

when I am loged on a site, with acertain Login, I can Logout and logon with
another username..WITHOUT closing the browser..

Cheers
Matt.
 
M

Marc

Matthieu said:
when I am loged on a site, with acertain Login, I can Logout and logon with
another username..WITHOUT closing the browser..

Delete your cookies and go to the login page.

Marc
 
R

Rob McAninch

Marc>:
Delete your cookies and go to the login page.

Depends if cookies are what is being used. It's not always the case.
Firefox 1.5 has an option to clear private data that may make it
simpler than clearing cookies, and should clear authentication
information as well.

This is mostly dependent on your browser, and perhaps an upstream
proxy server that could be misbehaving and caching data it shouldn't.
 
B

Benjamin Niemann

Matthieu said:
Hi ,

how can I , as a Site User (Visitor) when i loged in with .htaccess logout
myself again without closing my browser. Do you know any solutions in PHP
, send a Header or something.

I guess with 'logged in with .htaccess', you mean HTTP authentication.

There is usually no way to 'logout' except for closing the browser - the
words 'login' and 'logout' are in fact wrong when talking about HTTP
authentication, as HTTP is stateless and there is no user session to log
into or out of.

There is no way for a server tell a browser to forget the user credentials.
At least for FireFox the webdeveloper extension provides a menu option to
clear the user credentials, forcing the user to re-enter the credentials on
the next access (which is the closest thing to 'being logged out' HTTP can
offer).
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top