• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

warn the user before session timeout & login back when session time out is over

 
sridevi karampudi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

when user is inactive, warn popup has to come before session timeout and if user click OK it should add the session timeout period and

If user can't respond to that he can back to login when session timeout is over.

Can anyone help me how to handle javascript function how to work on this .Having one doubt like can we do this using javascript itself without setting time into web.xml file

I am not having any idea how to do this. Please help me this is critical issue for me

 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4253
227
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't need to specify anything related to sessions on web.xml, setMaxInactiveInterval method of HttpSession can be used to specify the timeout period. In order to warn before the session timeout, you can use getLastAccessedTime() to track how long the user has been idling. All these tracking things should be done in server side, so no JavaScript involvement should be there for tracking. Once the server-side tracking code has figured out that it's the time to notify the client, some client-side JavaScript code can get notified, probably through server-push calls.

Since this question is not specific to JSP, I'm moving this to Servlets forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to HTML/JavaScript.

Please SearchFirst. This has been discussed before.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic