Bug 44705 - Tomcat 5.5.26 - cookie with colon in name is parsed incorrectly
Summary: Tomcat 5.5.26 - cookie with colon in name is parsed incorrectly
Status: RESOLVED DUPLICATE of bug 46597
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Servlet & JSP API (show other bugs)
Version: 5.5.26
Hardware: PC Windows XP
: P1 critical with 1 vote (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords: RFC
Depends on:
Blocks:
 
Reported: 2008-03-28 18:18 UTC by David Lewis
Modified: 2009-03-27 07:46 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Lewis 2008-03-28 18:18:33 UTC
Tomcat 5.5.26 appears to be incorrectly parsing cookies whose name contains a colon (":"). The portion of the name that prefixes the colon remains, but the value for the cookie is an empty string.

Tomcat 5.5.25 and earlier:
--------------------------
HTTP request contains header:
Cookie: JSESSIONID=87C7E668C6C15E2556C0977F6EAA9F4C; NFIS:profile=lang=en; DACS:NFIS:NRCAN:dlewis=usjp1tigSqakP8BnWv

* When the HttpServletRequest.getCookies() is called, a Cookie[] is returned:
Cookie: name="JSESSIONID", value="J87C7E668C6C15E2556C0977F6EAA9F4C"
Cookie: name="NFIS:profile", value="lang:en"
Cookie: name="DACS:NFIS:NRCAN:dlewis", value="usjp1tigSqakP8BnWv"

Tomcat 5.5.26:
--------------
HTTP request contains header:
Cookie: JSESSIONID=87C7E668C6C15E2556C0977F6EAA9F4C; NFIS:profile=lang=en; DACS:NFIS:NRCAN:dlewis=usjp1tigSqakP8BnWv

* When the HttpServletRequest.getCookies() is called, a Cookie[] is returned:
Cookie: name="JSESSIONID", value="J87C7E668C6C15E2556C0977F6EAA9F4C"
Cookie: name="NFIS", value=""
Cookie: name="DACS", value=""

This issue "breaks" many of the cookies that we use with our applications. The only solution (for now) is to use Tomcat 5.5.25.
Comment 1 Filip Hanik 2008-03-28 19:12:39 UTC

*** This bug has been marked as a duplicate of bug 44679 ***
Comment 2 Mark Thomas 2008-07-31 11:59:58 UTC

*** This bug has been marked as a duplicate of bug 44679 ***
Comment 3 daniel granat 2008-07-31 12:56:05 UTC
Bug 44679 is fixed.This bug (44705) will never be fixed because it's version 5.5.26
How can this bug be a duplicate of 44679, and yet it's not fixed?!

It's better to change it to WONTFIX!
Comment 4 Mark Thomas 2008-07-31 13:09:11 UTC
It is a dup because it is the same issue and the same fixes have been applied to 5.5.x and 6.0.x

Generally, we use the same bug ID for the same issue across multiple versions.

*** This bug has been marked as a duplicate of bug 44679 ***
Comment 5 Haim Ashkenazi 2008-08-03 04:56:39 UTC
I'm a little confused. This is solved for version 6, but what about tomcat 5.5. Is there going to be a release 5.5.27 which solves this bug?
Comment 6 Mark Thomas 2008-08-03 05:56:18 UTC
Bugs are closed once the fix is applied to the source.

Please stop re-opening this bug. It has been dealt with.

*** This bug has been marked as a duplicate of bug 44679 ***
Comment 7 David Lewis 2008-08-12 10:09:10 UTC
As per comment #5, is there a release date set for Tomcat 5.5.27? We have many servers that need upgrading - but right now we are still using 5.5.25.
Comment 8 David Lewis 2008-11-19 15:45:27 UTC
Although the fix for this issue has been incorporated into the Tomcat 6.0.x stream, I gather from this post that is has not been incorporated into 5.5.27.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44679#c27

This oversight means that I cannot upgrade to a later version of Tomcat 5.5.x as my cookies break with all later versions newer than 5.5.25. I must upgrade to Tomcat 6.0.x. So why bother issuing further bug fixes for Tomcat 5.5.x! :-(
Comment 9 David Karnok 2008-12-22 01:27:40 UTC
I have also issues with the new cookie parsing. In my case, a load balanced Tomcat 5.5.26 application configured to use AJP causes the JSESSIONID cookie to have the host and port number attached to it:
JSESSIONID=A54351F6255622340BCCB76397C80A84.server01:8080
Unfortunately, this is now an illegal cookie and any application running on it experiences strange session recreation issues. Is there a way to format the session cookie differently?
Comment 10 Mark Thomas 2008-12-27 14:22:55 UTC
As a workaround use server01-8080 for your jvmRoute rather than server01:8080
Comment 11 Mark Thomas 2009-03-27 07:46:15 UTC
I have ported all the cookie changes from 6.0.x to 5.5.x. This is being tracked in bug 46597 so I am marking this issue as a dup of that one.

*** This bug has been marked as a duplicate of bug 46597 ***