bergsten    00/11/14 20:19:20

  Modified:    src/share/org/apache/tomcat/session Tag: tomcat_32
                        StandardSessionInterceptor.java
  Log:
  Fix to Bug Report #380
  
  Added code for setting the session in the Request for the case
  when the session ID is received as part of the URL.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.2   +14 -0     
jakarta-tomcat/src/share/org/apache/tomcat/session/StandardSessionInterceptor.java
  
  Index: StandardSessionInterceptor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/session/StandardSessionInterceptor.java,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- StandardSessionInterceptor.java   2000/11/11 02:07:02     1.5.2.1
  +++ StandardSessionInterceptor.java   2000/11/15 04:19:19     1.5.2.2
  @@ -85,6 +85,7 @@
    * session stuff ( cookie, rewrite, etc)
    *
    * @author [EMAIL PROTECTED]
  + * @author [EMAIL PROTECTED] (fixed it so that URL session ID is used)
    */
   public final class StandardSessionInterceptor  extends BaseInterceptor {
       int manager_note;
  @@ -121,6 +122,19 @@
            log( "Configuration error in StandardSessionInterceptor - no context " + 
request );
        }
   
  +      // Added by Hans:
  +      // First check if we have a valid session ID from the URL, set by the 
SessionInterceptor,
  +      // and if so, set it as the request session. If we have also received a valid 
session ID
  +      // as a cookie, the next section of code will reset the session to the one 
matching the
  +      // ID found in the cookie.
  +      String requestedSessionID = request.getRequestedSessionId();
  +      if (requestedSessionID != null) {
  +          if (debug > 0) log("Found URL session ID: " + requestedSessionID);
  +          sess = sM.findSession(requestedSessionID);
  +          if (sess != null)
  +              if (debug > 0) log("The URL session ID is valid");
  +              request.setSession(sess);
  +      }
   
        // PF, loop across all cookies named JSESSIONID checking to see if any of them 
are valid.
        // There should in most cases be a maximum of 2, and normally there will only 
be one. The
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to