Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to remove the session value...

 
vishnu mohan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, how can i kill all the session value, while the USE CLOSE THE BROWSER. which servlet METHOD i called before closing the browser.
Thanks and regards,Vishnu
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vishnu,
We have a naming policy here at JavaRanch where all publicly displayed names take the form, "Firstname Lastname". Could you please change yours to bring it into line?
Thanks in advance and we hope that you enjoy your stay at the JavaRanch!

ersin
 
Rajendar Goud
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi vishnu,
u can use the invalidate() method for removing a session.
<% session.invalidate(); %>
Invalidates the session and removes all objects stored within the session.
cheers,
Raj
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The javascript event onUnLoad will be called when the browser is closed ..but it is also called when the refresh button is called...
Better set the session time out in web.xml or programmatically using setMaxInactiveInterval of HttpSession i/f so that session is killed after the set interval of inactivity...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic