1

I came across clearing authentication cache between browsers (FireFox and Chrome) by using JavaScript.

By reference from this post Link, the portion using XMLHttpRequest to clear cache for non IE browser not working in my situation.

I was looking for alternative way, any suggestion? please help

Thank you in advanced.

2 Answers 2

1

I've been searching for a similar solution and came across a patch for Trac (an issue management system) that does this.

I've looked through the code (and I'm tired, so I'm not explaining everything); basically you need to do an AJAX call with guaranteed invalid credentials to your login page. The browser will get a 401 and know it needs to ask you for the right credentials next time you go there. You use AJAX instead of a redirect so that you can specify incorrect credentials and the browser doesn't popup a dialog.

On the patch (http://trac-hacks.org/wiki/TrueHttpLogoutPatch) page they use very rudimentary AJAX; something better like jQuery or Prototype, etc. is probably better, although this gets the job done.

Sign up to request clarification or add additional context in comments.

Comments

1

Precise rules of browser's handling of supplied credentials - if they'll be saved when provided from Javascript and if correct or incorrect tries will overwrite authentication cache are not standartised anywhere.

Additionally, developers tend to consider anything that allows to unattended manipulation of storage that usually requires user's manual interaction, like those "do you want to save password?" prompts, as insecure and promptly plug the holes even if it worked in the past for some reason.

Therefore I recommend not to depend on it and do not try to clear/invalidate this cache from your script.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.