I don't have the code. I am looking for some sample code, which can clear session cookies in firefox when a user closes the window instead of clicking the logout button.
I need to clear the session after firefox browser is closed. I was looking for a javascript event and code which will clear the session cookie when a firefox window i closed.
Have you searched google?? There are tons of scripts available like this or this. And since the JSESSIONID cookie's age is -1, it should be automatically be removed when the browser window is closed??
Session cookies expire when the browser is closed, permanent cookies do not. I do not need to test it. If they do not delete when ALL of the browser windows are closed, I am betting you are NOT using session cookies.
How are you setting these cookies. Show us some code.
Transient session cookies will expire when you close ALL windows. Persistent session cookies don't expire even if you close all windows.
Try 2 following scenarios on Fire fox 3.5
Scenario A {Persistent cookies}
1.) open window A. login into yahoo/gmail accounts
2.) Close window A.
3.) Open a NEW Firefox instance B. Browse to yahoomail/gmail. You will be directly logged into your mail box.
I guess they are using persistent cookies. If you use transient cookies, it will not cache your session/request.
Scenario B {Transient cookies}
1.) create a test/find web application using transient cookies.{We did for our web application at the SiteMinder level}
2.) open window A.
3.) Login into the test application.
4.) open New Instance B. open google.com
5.) Close window A.
6.) Open Insatnce C. Browse to page after login in the test application. You will be directly logged into the application.
I am looking for a solution which can prevent the scenario B from happening in Fire Fox.