• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 7134
1360
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: 67746
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.
 
Fire me boy! Cool, soothing, shameless self promotion:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic