Author: markt
Date: Fri Dec 28 13:14:20 2007
New Revision: 607332

URL: http://svn.apache.org/viewvc?rev=607332&view=rev
Log:
Fix 43839. URL based session tracking failed when a session cookie from a 
parent context was present. Based on a patch by Yuan Qingyun.

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=607332&r1=607331&r2=607332&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Dec 28 13:14:20 2007
@@ -66,13 +66,6 @@
   +1: markt,funkman, yoavs
   -1: 
 
-* Fix http://issues.apache.org/bugzilla/show_bug.cgi?id=43839
-  URL based session tracking fails when session cookie from parent context is
-  present. Based on a patch by Yuan Qingyun.
-  http://svn.apache.org/viewvc?rev=606944&view=rev
-  +1: markt,funkman, pero, yoavs
-  -1: 
-
 * Fix http://issues.apache.org/bugzilla/show_bug.cgi?id=42503
   ServletContext.getResourceAsStream returns stale data
   http://svn.apache.org/viewvc?rev=606994&view=rev

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=607332&r1=607331&r2=607332&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 
Fri Dec 28 13:14:20 2007
@@ -547,6 +547,13 @@
      */
     protected void parseSessionCookiesId(org.apache.coyote.Request req, 
Request request) {
 
+        // If session tracking via cookies has been disabled for the current
+        // context, don't go looking for a session ID in a cookie as a cookie
+        // from a parent context with a session ID may be present which would
+        // overwrite the valid session ID encoded in the URL
+        if (!((Context)request.getMappingData().context).getCookies())
+            return;
+
         // Parse session id from cookies
         Cookies serverCookies = req.getCookies();
         int count = serverCookies.getCookieCount();

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=607332&r1=607331&r2=607332&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Fri Dec 28 13:14:20 2007
@@ -133,6 +133,11 @@
         a scriptlet there is a one to one line mapping. (markt/jim)
       </fix>
       <fix>
+        <bug>43839</bug>: URL based session tracking failed when a session
+        cookie from a parent context was present. Based on a patch by Yuan
+        Qingyun. (markt)
+      </fix>
+      <fix>
         <bug>43914</bug>: URLs in location headers should be encoded. Patch
         provided by Ivan Todoroski. (markt)
       </fix>



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

Reply via email to