File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Session Management in java" Watch "Session Management in java" New topic

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.

M. Bharathi

Ankit Garg

Joined: Aug 03, 2008
Posts: 9462

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:
subject: Session Management in java
It's not a secret anymore!