File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Session Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session Query" Watch "Session Query" New topic

Session Query

Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi All,

Good Day!!!

I have this query to ask about session since I have'nt made use of session that much. I hope I had posted on the right forum.

If I set this configuration in my web.xml for session configuration.

It means user has 10 minutes to login to the web application before the session will be invalidated by the server if I did not explicitly invalidate the session by calling session.invalidate.

If I have this scenario, user logs into the system on the 1st minute and a new session was created, but then the user disappears..

User then comes back before the 10 minute expires then do some heavy processing, chances are my session attributes would be lost when the 10 minutes is exceeded?

My assumption is that the web server will invalidate the session regardless of the continuous request from the user since time already expires? Am i correct with this assumption? From what I have understand, session starts the moment a new session was created and session will be retain on the server regardless of the activity/inactivity from the user.

Is it good design to just let the session times-out and forward the user to the JSP telling them that the session has time out or is there an API for session extension?

Thanks to all..

Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
sudhir nim
Ranch Hand

Joined: Aug 29, 2007
Posts: 212

Session time out specifies the maximum inactive time interval after which session will be invalidated. It applies only when user remain inactive (in other words theres no user request) for the specified amount of time.
If theres any user request before session timeout, session will not be invalidated up to next time out interval.

[Servlet tutorial] [Servlet 3.0 Cook Book]
I agree. Here's the link:
subject: Session Query
jQuery in Action, 3rd edition