wood burning stoves 2.0*
The moose likes JSP and the fly likes session expiring causes problems... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "session expiring causes problems..." Watch "session expiring causes problems..." New topic

session expiring causes problems...

Peter Straw
Ranch Hand

Joined: Jan 08, 2002
Posts: 79
If a browser window is left open for a some time while the user is logged in and the session expires, tomcat shows an ugly error message to the user. Is there a way to prevent this? Like automatically displaying a login page when the session has timed out? Please help...
Many thanks
Zac Roberts
Ranch Hand

Joined: Jan 29, 2002
Posts: 82
I believe you can edit the default timeout period for a session. From BEGINNING JSP (Wrox):
"The developer can also change this timout using the setMaxInactiveInterval() method; the timeout period used by these methods is defined in seconds. If the timeout period for a session is set to -1, the session will never expire."
You can also edit your web.xml like this:
I believe another option would be to use Tomcats built in form based log in mechanism. Then if your session times out, your are automatically sent to the login page in which you must reenter your username and password.
Hope this helps

Zac Roberts<br />SCJP2
Zac Roberts
Ranch Hand

Joined: Jan 29, 2002
Posts: 82
In the above code, ignore the:
I agree. Here's the link: http://aspose.com/file-tools
subject: session expiring causes problems...
Similar Threads
User Behavior Tracing
How to show the user session information in the log file?
Managing Session
listing all online users on a JSP page
why don�t we get previous page after signing out?