How to ensure user session destroyed wn browser closed Withought user logged out.
Today I faced a problem in my java application .User session didn't destroy wn I directly closed browser without logout user. After some time (less than default time which is described in web.xml) wn I again open browser I get old session. HTTTP protocol is stateless protocol so how it is possible to destroy sessions wn randomly closed browser Withought logout.
Wt I have done, first I tried to put session time 30 sec by default in web.xml. but its not right way.
Second I have stored all valid session in Hashmap.browser closed but Session exists with user id .wn user logged in again, first I checked hashmap if user's session exists i closed user session and then again logged in with new session. Actually my problem is solved but wn I analysed java point of view I get many overheads like wt will happen wn my system will execute in distributed environment... I done google but did't find right answers. Now I am trying to find answer in "Head and first" book .
if anyone have better answer kindly share.....