Hello Friends, I am not calling any invalidate function in my code. I need to know when exactly a session will be closed or expaired. Is it that If the client closes his browser , the session will be expaired ? I need this very urgently.
Hello SeethaRam, The invalidate method will be called when the user clicks on the logout button(when u write this method in a jsp or servlet and this page is linked to Logout button).Hope this answer satisfies ur question. Ravi
session expires only when when : 1. you specifically invalidate it 2. when there is a server timeout occurs. in first condition you have complete control and you can do the cleanup(like closing databse connection) in second condition you do not have any control because http is an stateless protocol. so you can know abt the session timeout only when you implement "HttpSessionBindingListener" and override the Valueunbound method in it.