Page 1 of 1

How do you logout from browser authentication (.htaccess)?

Posted: Fri Aug 25, 2006 5:06 am
by zeek
I am testing a site that uses browser authentication (.htaccess/.htpasswd). I often need to switch users, but sometimes it's not convenient to close the browser (to logout). An example would be right now. I'm logged in a user1. I need to test being logged in as admin1, but I'm downloading an iso file, so I can't close the browser to 'logout' of the user1 account.

Is there a way to 'logout' from an .htaccess protected site without closing the browser? Thanks.

Posted: Fri Aug 25, 2006 9:56 am
by pickle
If there is, I've never heard of it.

Posted: Fri Aug 25, 2006 10:05 am
by volka
You can send a new "401 unauthorized" header.
All browsers (I know of ;)) then remove current credentials and ask the user for new ones.