Author
Checking for valid session
ShivPrakash Srivastava
Ranch Hand
Joined: Mar 24, 2005
Posts: 88
Hi, Is there any method in HttpSession or in the request to check for session timeout? Thanks and Regards Shiv
Rahul Bhattacharjee
Ranch Hand
Joined: Nov 29, 2005
Posts: 2300
if request.getSession(false) is null , then session has timed out or never created.
Rahul Bhattacharjee
LinkedIn - Blog
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
The simplest way, I've found, is to bind an object to session when a user logs in. Then check to see if that object exists (is not null).
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
pascal betz
Ranch Hand
Joined: Jun 19, 2001
Posts: 547
posted Dec 12, 2006 06:43:00
0
add a Session listener ? pascal
ShivPrakash Srivastava
Ranch Hand
Joined: Mar 24, 2005
Posts: 88
Hi All, Thanks to all of you for your response. Thanks and Regards Shiv
subject: Checking for valid session