You can approach the problem from the other direction.

If the session has expired then the current session will still be new.
<%
boolean lb_test = session.isNew() ;
if (lb_test) out.print("we have a new session");
%>

isNew
Returns "true" if a session object has been created but not accessed by
client. Returns "false" if a session object has been used by the client.


Of course you can also tell by the fact if your session is invalidated then
you will get a IllegalStateException exception and you can work from that
angle also

Casey Kochmer
[EMAIL PROTECTED]
www.jspinsider.com

>From: "Narayanaswamy, Kumaran (CTS)" <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>     reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: How to Identify whether a session has expired
>Date: Thu, 14 Sep 2000 01:47:20 -0400
>
>Hi
>Is there any method to find whether a session has been expired?
>
>with regards,
>Kumaran

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to