4 Replies Latest reply on Oct 21, 2008 8:43 AM by Kenny Zhang

    request.isRequestedSessionIdValid does not work

    Kenny Zhang Newbie

      Hi all,

      During my work, I use request.isRequestedSessionIdValid to check whether the session is valid before I invalidate one session, the code is like below:

      if (request.isRequestedSessionIdValid()){
       session.invalidate();
       }


      However, those codes do not always work correctly. Sometimes, there will be IllegalStateException caused by the 'session.invalidate', the stack trace is like below:
      java.lang.IllegalStateException: invalidate: Session already invalidated
      at org.jboss.web.tomcat.service.session.ClusteredSession.invalidate(ClusteredSession.java:669)
      at org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:150)
      .

      Can anybody tell me why?
      Thanks in advance.

      BTW: while doing the search across the forum, I find one post which covered the similar issue:
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=135699,
      but unfortunately, there is no reply for that post.