tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core RequestImpl.java
Date Sun, 05 Nov 2000 07:01:51 GMT
craigmcc    00/11/04 23:01:51

  Modified:    src/share/org/apache/tomcat/core Tag: tomcat_32
                        RequestImpl.java
  Log:
  Allow the following sequence to work:
  	HttpSession session = request.getSession(true);
  	...
  	session.invalidate();			// Invalidate old session
  	session = request.getSession(true);	// Get a new session
  
  In case this bug looks familiar, I had to fix it in 3.1 also.  Oh well,
  at least 4.0 does this right out of the box ...
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.52.2.2  +11 -1     jakarta-tomcat/src/share/org/apache/tomcat/core/Attic/RequestImpl.java
  
  Index: RequestImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Attic/RequestImpl.java,v
  retrieving revision 1.52.2.1
  retrieving revision 1.52.2.2
  diff -u -r1.52.2.1 -r1.52.2.2
  --- RequestImpl.java	2000/07/03 09:38:01	1.52.2.1
  +++ RequestImpl.java	2000/11/05 07:01:50	1.52.2.2
  @@ -459,7 +459,17 @@
       public HttpSession getSession(boolean create) {
   	if( serverSession!=null ) {
   	    // if not null, it is validated by the session module
  -	    return serverSession;
  +            // when initially requested, but an invalidated session
  +            // must be rechecked
  +            // NOTE:  The only way to check validity is to access
  +            // a property that returns IllegalStateException if not
  +            try {
  +                serverSession.getCreationTime();
  +            } catch (IllegalStateException e) {
  +                serverSession = null;
  +            }
  +            if (serverSession != null)
  +                return serverSession;
   	}
   
   	if( ! create ) return null;
  
  
  

Mime
View raw message