Handle the scenario where the client sends multiple JSESSIONID cookies. This patch...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 15 Mar 2011 20:49:44 +0000 (20:49 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 15 Mar 2011 20:49:44 +0000 (20:49 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1081940 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/Request.java
webapps/docs/changelog.xml

index f30e7ac..de009b5 100644 (file)
@@ -2309,7 +2309,23 @@ public class Request
         }
         
         if ((session == null) || !session.isValid()) {
-            return false;
+            // Check for parallel deployment contexts
+            if (getMappingData().contexts == null) {
+                return false;
+            } else {
+                for (int i = (getMappingData().contexts.length); i > 0; i--) {
+                    Context ctxt = (Context) getMappingData().contexts[i - 1];
+                    try {
+                        if (ctxt.getManager().findSession(requestedSessionId) !=
+                                null) {
+                            return true;
+                        }
+                    } catch (IOException e) {
+                        // Ignore
+                    }
+                }
+                return false;
+            }
         }
 
         return true;
index 9454b54..b6275db 100644 (file)
         Remove unnecessary whitespace from MIME mapping entries in global
         web.xml file. (markt)
       </fix>
+      <fix>
+        When using parallel deployment, correctly handle the scenario when the
+        client sends multiple JSESSIONID cookies. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">