This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Servlets and the fly likes keeping the session alive Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "keeping the session alive" Watch "keeping the session alive" New topic
Author

keeping the session alive

ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 192
Hi all,

I want to know is there any way to keep the user session alive although user is idle beyond session timeout interval.
For some reasons i dont want to increase session timeout duration but still i want that user operation becomes succesfull by keeping the session alive in backgroud.

regards,
Ajse
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9191
    
    2

Well the solution is simple. Make an AJAX request to the server at regular intervals like 15mins to a do-nothing servlet to keep the session alive.

And if you want the session to remain alive for a particular page like a page where user enters long information, then you can set the session time out on the session object in a servlet or JSP for that particular situation i.e. use the setMaxInactiveInterval method of the HttpSession class...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: keeping the session alive
 
Similar Threads
Tabs within one browser share Session, but I want to capture close and time out event for each tab
Forcing Relogin
Session timeout in struts
session invalidation of an active user
How to return to self page after clicking Confirm box OK button