// Clear current credentials // Requires IE6 SP1 or later document.execCommand(ClearAuthenticationCache)
Unfortunately, the ClearAuthenticationCache command is not available to others browsers in this case, so in order to do this really need to close the browser or, if it works for you, make an ajax call with wrong credentials to make your latest credentials saved to browser authentication cache be a 401 for that site. Mixing this all together we can have a javascript code like this one:
References:
http://www.adopenstatic.com/cs/blogs/ken/archive/2005/04/12/14.aspx
http://stackoverflow.com/questions/31326/is-there-a-browser-equivalent-to-ies-clearauthenticationcache
http://stackoverflow.com/questions/1205045/how-to-clear-authentication-cache-on-ie7-with-javascript
http://www.nanodocumet.com/?p=6
http://msdn.microsoft.com/en-us/library/ms536979(v=vs.85).aspx
http://code.google.com/p/chromium/issues/detail?id=5497
http://trac-hacks.org/wiki/TrueHttpLogoutPatch
Hi, just tested this. But got wierd problem. When I click log out button with that code it's logged out, but cannot access to that site again for a while. Do you know anything about this?
ReplyDeleteThat's really weird... that never happened with me... every time you clear authentication cache you have to log in again...
ReplyDeleteIf you clear the browser cache it still happens in that time?
which browser? if is FF take a look here: https://support.mozilla.org/en-US/kb/fix-login-issues-on-websites-require-passwords
Do you have any kind of cookie that prevents logging in? clearing the cache this should not be a problem...
Tell me how you manage this after please...