This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 12676
    
    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

Java Resources at www.wbrogden.com
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to notice the user about session expire before (n) min
 
Similar Threads
Session Time out Issue
session time out in application after specific time
regarding session
Server Session Timeout
Session time-out notification