Dave,
    There are multiple ways provided by the Servlet API which will tell you whether the current session is valid (is not expired). The HttpServletRequest has a method called  isRequestedSessionIdValid() (http://java.sun.com/j2ee/1.4/docs/api/index.html). A false return from this method indicates that the request is associated with an expired session. You can also query the HttpSession object by calling the isNew() method which will tell you whether you have a new session as opposed to an expired session.
 
Hope this helps,
Swarn


From: Dave [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 09, 2006 9:49 PM
To: users@myfaces.apache.org
Subject: expired session or new session?

I like to display a message to user saying "Session Expired" when a session expires.
After a session expired, everything in session scope are gone. So my question actually becomes:
 
How to tell the difference between "Expired Session" and new session?
 
Thanks!


Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.

Reply via email to