You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2008/06/24 19:56:25 UTC

DO NOT REPLY [Bug 45272] New: Version 1 cookie not persisted in IE

https://issues.apache.org/bugzilla/show_bug.cgi?id=45272

           Summary: Version 1 cookie not persisted in IE
           Product: Tomcat 5
           Version: 5.5.26
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: tomcat@alishabeth.com


A cookie with value
"MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D"
and version 1 is persisted correctly and returned using tomcat 5.5.26 and
Firefox but not persisted using tomcat 5.5.26 and IE.

This issue is not present in 5.5.25.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45272] Version 1 cookie not persisted in IE

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45272


Filip Hanik <fh...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME




--- Comment #1 from Filip Hanik <fh...@apache.org>  2008-06-25 09:03:23 PST ---
Here is my JSP

<%@ page import="javax.servlet.http.*" %>
<%
Cookie[] myCookies = request.getCookies();

  for(int n=0; myCookies!=null && n < myCookies.length; n++)
  {
    out.print(myCookies[n].getName() + " : ");
    out.print(myCookies[n].getValue() + "<BR>");
  }

 Cookie c = new
Cookie("TestCookie","MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D");
 c.setVersion(1);
 response.addCookie(c);
%>

and here is the IE output

JSESSIONID : 335EF2DF68ED0A12A148AB2A63CCC528
TestCookie :
MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45272] Version 1 cookie not persisted in IE

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45272





--- Comment #6 from Filip Hanik <fh...@apache.org>  2008-06-25 14:15:14 PST ---
One potential fix is to treat the path value for quoting as v0 

Index: java/org/apache/tomcat/util/http/ServerCookie.java
===================================================================
--- java/org/apache/tomcat/util/http/ServerCookie.java  (revision 671643)
+++ java/org/apache/tomcat/util/http/ServerCookie.java  (working copy)
@@ -299,7 +299,7 @@
         // Path=path
         if (path!=null) {
             buf.append ("; Path=");
-            maybeQuote2(version, buf, path);
+            maybeQuote2(0, buf, path);
         }

         // Secure

and that will only quote the path if it contains :; or a space

however, this again, opens up the wormhole of 
setPath("/=somepath==");

and would break, potentially, the javax.servlet.http.Cookie.setPath should do a
check

will come back


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45272] Version 1 cookie not persisted in IE

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45272





--- Comment #5 from Filip Hanik <fh...@apache.org>  2008-06-25 13:54:01 PST ---
temporary work around is to leave out the 
setPath("/");

it seems to be IE mishandling a quoted path value, which is supported by the
spec, I will let you know when I dug deeper into the problem

Filip


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45272] Version 1 cookie not persisted in IE

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45272


Dave <to...@alishabeth.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |




--- Comment #2 from Dave <to...@alishabeth.com>  2008-06-25 09:32:43 PST ---
Here's a reproducible test case, with a path of "/" and version 1 the cookie is
not persisted in IE, with the same path and no version the cookie is persisted.
 Both cookies are persisted in FireFox

<%@ page import="javax.servlet.http.*" %>
<%
Cookie[] myCookies = request.getCookies();

  for(int n=0; myCookies!=null && n < myCookies.length; n++)
  {
    out.print(myCookies[n].getName() + " : ");
    out.print(myCookies[n].getValue() + "<BR>");
  }

 Cookie version0Cookie = new Cookie(
                 "TestCookiev0" + (new java.util.Date()).getTime(),
                
"MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D");
 version0Cookie.setPath("/");
 // version2Cookie.setVersion(1);
 response.addCookie(version0Cookie);

 Cookie version1Cookie = new Cookie(
                 "TestCookiev1" + (new java.util.Date()).getTime(),
                
"MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D");
 version1Cookie.setPath("/");
 version1Cookie.setVersion(1);
 response.addCookie(version1Cookie);
%>


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45272] Version 1 cookie not persisted in IE

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45272





--- Comment #7 from Filip Hanik <fh...@apache.org>  2008-06-26 11:26:26 PST ---
Created an attachment (id=22180)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22180)
Patch for IE cookie behavior

Patch checked into trunk, proposed for backport to 6.0


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45272] Version 1 cookie not persisted in IE

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45272


Filip Hanik <fh...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




--- Comment #8 from Filip Hanik <fh...@apache.org>  2008-06-30 13:05:04 PST ---
Fixed in 6.0.x
will be available in 6.0.17 onward


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45272] Version 1 cookie not persisted in IE

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45272





--- Comment #3 from Dave <to...@alishabeth.com>  2008-06-25 09:37:50 PST ---
IE output from tomcat 5.5.25
JSESSIONID : C286C4880C485442FB839DA4A8611A9A
TestCookiev01214411760128 :
MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D
TestCookiev11214411760129 :
MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D
TestCookiev01214411761646 :
MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D
TestCookiev11214411761647 :
MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D



IE Output from tomcat 5.5.26
JSESSIONID : E7921B0F67630CC435B7E970D7D008D0
TestCookiev01214411874807 :
MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D
TestCookiev01214411876520 :
MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45272] Version 1 cookie not persisted in IE

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45272





--- Comment #4 from Filip Hanik <fh...@apache.org>  2008-06-25 13:39:15 PST ---
I see what is happening, IE is probably rejecting the quoted path value

Set-Cookie:
TestCookiev01214425641703=MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D;
Path=/
Set-Cookie:
TestCookiev11214425641703=MIGCBgkrBgEEAYI3WAOgdTBzBgorBgEEAYI3WAMBoGUwYwIDAgABAgJmAwICAMAECN7UUhW1gKdu%0ABBBgywr0Nm%2FxNVdoCHCcNMB2BDiF%2FIwn6i47%2B1H0fKHpkJeDVFhEvyYKke1zTGupImD7r2JOcdo%2F%0A6%2FK85sELQu%2BbOW%2BH9lhDfwdxHA%3D%3D;
Version=1; Path="/"


I will take a look at it

best
Filip


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org