| 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
Saloon Keeper
Joined: Jul 29, 2008
Posts: 2691
|
|
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 (Download) - the free mock exam kit for SCJP / OCPJP
Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56173
|
|
Moved to HTML/JavaScript.
Please SearchFirst. This has been discussed before.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: warn the user before session timeout & login back when session time out is over
|
|
|