From: markt Date: Tue, 15 Mar 2011 20:49:44 +0000 (+0000) Subject: Handle the scenario where the client sends multiple JSESSIONID cookies. This patch... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6538f6923000c3374d94fcd1d18622bb88d84d6c;p=tomcat7.0 Handle the scenario where the client sends multiple JSESSIONID cookies. This patch trades a little duplication for simpler code. The duplication only occurs when the client sends multiple cookies and the request is to a context that currently has multiple versions. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1081940 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/connector/Request.java b/java/org/apache/catalina/connector/Request.java index f30e7aceb..de009b5b3 100644 --- a/java/org/apache/catalina/connector/Request.java +++ b/java/org/apache/catalina/connector/Request.java @@ -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; diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 9454b5458..b6275db21 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -69,6 +69,10 @@ Remove unnecessary whitespace from MIME mapping entries in global web.xml file. (markt) + + When using parallel deployment, correctly handle the scenario when the + client sends multiple JSESSIONID cookies. (markt) +