wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Pop up window to the user when session is about to timeout. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Pop up window to the user when session is about to timeout." Watch "Pop up window to the user when session is about to timeout." New topic
Author

Pop up window to the user when session is about to timeout.

Shwetha Jagadish
Greenhorn

Joined: Mar 28, 2011
Posts: 11
Hi All,

I want to have a Pop up Window to the user when the session is about to time out asking to continue with the current session or logout.

For example : If i have specified 10 minutes as session timeout in web.xml and if the user doesn't do perform anything for 8 minutes, then i want to have a pop up window with the message
(Ex. : This screen will timeout in 2 minutes. Do you need more time?)

Please suggest how to do this?

Thanks,
Shwetha.
Marcin Kwiatkowski
Ranch Hand

Joined: Aug 06, 2007
Posts: 32

You can implement the whole thing in JavaScript, simply display a popup after given time.
Rocky Khan
Greenhorn

Joined: Oct 18, 2011
Posts: 11

Use the following script to pop up the window after some fixed time period...
just call the function myPopup(ans); after the fixed time..
'ans' Variable will contain the choice of user(i.e. want to continue or not)...



Create on jsp file named 'dispDialog.jsp' ask for user choice and a submit button...
add the following code to return the 'ans' to parent window..



I think this will help...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Pop up window to the user when session is about to timeout.
 
Similar Threads
Controlling Session Timeout in JSP
Session Timeout Timer Reset
Session Time-Out problem
Http header 'referer' NULL in Servlet for pop-up window
Warning a user that something will timeout