java - How to force delete cookies even if one window is still open? -


In IE8, this option apparently 'preserve favorite website data', even if I unchecked it, the browser still keeps cookies until the last window is closed.

The problem scenario is that I am logged into somesite.com, without logging out, I closed the window, but still another IE8 window was opened in this case IE8 will keep cookies on this site. So if I open the site again (one window or other) then the site will not ask for login information.

Customer wants to log off the web application as soon as the user closes the browser Can I delete cookies that save IE8? Or maybe I can stop the user from closing the window until I can not simulate a click on the logout button?

Thanks everything, I have tried many ways including you, and it did not work.

My solution was as follows: When the user clicks the X button (the browser closes), a JavaScript onunload function will be called this function logout Clicks on the button. The function prevents the browser until the logout is executed.

Code:

  window.onunload = function () {document.getElementById ('logoutLink') Click (); Windows.setTimeout (doNothingFunction, 2000); }  

On the one hand, the effect is that this function will actually move the user out of the current page every time, not only on the window shutdown.
Solutions, on the page while navigating from the page, a flag is set to the wide opening to false . But when the user clicks on the X button, the flag will not be set to false.

New function to solve side effects.

  window.onunload = function () {If (closingWindow) {document.getElementById ('logoutLink'). Click (); Windows.setTimeout (doNothingFunction, 2000); }}  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -