• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Sheriff
Posts: 6914
1314
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to HTML/JavaScript.

Please SearchFirst. This has been discussed before.
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic