You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dave <ja...@yahoo.com> on 2006/02/10 03:49:11 UTC
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.
RE: expired session or new session?
Posted by "Dr Swarn S. Dhaliwal" <sw...@gmail.com>.
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
<http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest
.html#isRequestedSessionIdValid%28%29> 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:javaone9@yahoo.com]
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
<http://us.rd.yahoo.com/mail_us/taglines/PMall/*http://photomail.mail.yahoo.
com> - it's free and works with Yahoo! Mail.