wood burning stoves 2.0*
The moose likes Struts and the fly likes Session Management in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Session Management in java" Watch "Session Management in java" New topic
Author

Session Management in java

muthu bharathi
Ranch Hand

Joined: Dec 10, 2008
Posts: 97
Hi Everybody....


I need the guidance for the following scenario

Session Expiry: 15 seconds before the session expires, show a pop-up with the time remaining running. Ask a question "Do You want to Continue?" On clicking Yes continue the session. On Clicking No kill the session.


--
regds,
M. Bharathi

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9307
    
  17

You'll have to send Ajax requests at continuous intervals to the server to check how old the session is. The server has no way of informing this to the client browser. Since the ajaz request will keep sending requests, so the session will not timeout automatically. Thus you'll have to manually invalidate a session if its too old. This can be done in the same program that will check how old the session is. You can store a session attribute which will store the time at which the session started or user pressed yes on the confirmation dialog which prompted the user whether to continue the session or not.

Is your application in Struts?? If not I'll move this thread to the appropriate forum...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session Management in java