• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Saravanan Ramamoorthy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic