• Post Reply Bookmark Topic Watch Topic
  • New Topic

again session  RSS feed

 
Thirumalaisamy Thangavel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have session variable for each user. When user clicks logout this will be made as null.But Instead of logout if the user closes the browser the session variable will not be null. So is there any way to make the session variable null when the user closes the browser.

thiru
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
Sessions will time themselves out.
 
Siri Reddy
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OR you can call the logout servlet when user closes the browser useing X button one the top right corner.
when user clicks on X button call the javascript function onUnload() and call Logout Servlet.
only problem is when user close the browser with close button under File Menu.

I Think this is userful for you.

Thanks,
Reddy
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't you hate it when the user doesn't use our applications the way they are designed?

You cannot depend on the session being killed when the client closes the browser. It is difficult to predict the state of the session when a user enters an application. Make sure you handle your sessions appropriately, or your user might end up getting someone else's session, or not be able to navigate through your site properly.

-Cameron McKenzie
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!