Two Laptop Bag
The moose likes JSP and the fly likes session expair Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "session expair" Watch "session expair" New topic

session expair

seetharama sarma

Joined: Oct 23, 2002
Posts: 5
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.
Ravi Kumar Ravuru
Ranch Hand

Joined: Apr 18, 2002
Posts: 176
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.
prabhat kumar
Ranch Hand

Joined: Apr 11, 2001
Posts: 114
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.
I agree. Here's the link:
subject: session expair
It's not a secret anymore!