aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes warn the user before session timeout & login back when session time out is over Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "warn the user before session timeout & login back when session time out is over " Watch "warn the user before session timeout & login back when session time out is over " New topic
Author

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

sridevi karampudi
Greenhorn

Joined: Dec 17, 2010
Posts: 5
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
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3220
    
  49

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.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

Moved to HTML/JavaScript.

Please SearchFirst. This has been discussed before.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
jQuery in Action, 2nd edition
 
subject: warn the user before session timeout & login back when session time out is over