File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes How to notice the user about session expire before (n) min Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to notice the user about session expire before (n) min" Watch "How to notice the user about session expire before (n) min" New topic
Author

How to notice the user about session expire before (n) min

Saravanan Ramamoorthy
Greenhorn

Joined: Feb 01, 2010
Posts: 1
Hi All,

How to notice the user about session expire before (n) min by providing popup alerts. If the user want to renew the session, need an option to provide the same.
Please provide your suggestions or reference.

Regards
Saravanan Ramamoorthy
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Since the server can not send anything to the client without a request, and a request would reset the session timer, your best bet is a countdown clock in Javascript running on the browser.

Bill
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
William Brogden wrote:Since the server can not send anything to the client without a request, and a request would reset the session timer, your best bet is a countdown clock in Javascript running on the browser.

Bill


This will not be accurate if your app is open in multiple browser-tabs. This question is pain in a$$. See two different approaches I tried.

http://www.coderanch.com/t/498067/JSP/java/catch-session-timeout-event

http://www.coderanch.com/t/498677/JSP/java/response-senRedirect-does-not-seem
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to notice the user about session expire before (n) min