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

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
zeek
Forum Commoner
Posts: 48
Joined: Mon Feb 27, 2006 7:41 pm

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

Post 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.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

If there is, I've never heard of it.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
Post Reply