Bug 49299 - Servlet 3.0 ch.7.1.1 says that custom cookie name affects URL rewriting
Summary: Servlet 3.0 ch.7.1.1 says that custom cookie name affects URL rewriting
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: trunk
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-15 17:38 UTC by Konstantin Kolinko
Modified: 2010-05-16 17:47 UTC (History)
0 users



Attachments
cookiename.war (2.01 KB, application/octet-stream)
2010-05-15 17:38 UTC, Konstantin Kolinko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kolinko 2010-05-15 17:38:08 UTC
Created attachment 25442 [details]
cookiename.war

In chapter 7.1.1 of servlet-3_0-final-spec.pdf it is said that

"If a web application configures a custom name for its session tracking cookies, the
same custom name will also be used as the name of the URI parameter if the session
id is encoded in the URL (provided that URL rewriting has been enabled)."

That is not true for the current trunk: the default "jsessionid" is used instead.

I am attaching a war file that reproduces this issue.


Steps to reproduce:
1. Deploy it as cookiename.war
2. Access http://localhost:8080/cookiename/
3. Actual result:
The page sends the following cookie:

Set-Cookie: MYSESSIONCOOKIE=658C60E714E9C7C833F4FDA366E0477F; Path=/cookiename; HttpOnly

but the Reload link on the page uses "jsessionid":

http://localhost:8080/cookiename/index.jsp;jsessionid=658C60E714E9C7C833F4FDA366E0477F

4. Expected result: if that phrase in 7.1.1 is to be followed, I would expect the Reload link to be

http://localhost:8080/cookiename/index.jsp;MYSESSIONCOOKIE=658C60E714E9C7C833F4FDA366E0477F
Comment 1 Mark Thomas 2010-05-15 19:24:26 UTC
(In reply to comment #0)
> 4. Expected result: if that phrase in 7.1.1 is to be followed, I would expect
> the Reload link to be
> 
> http://localhost:8080/cookiename/index.jsp;MYSESSIONCOOKIE=658C60E714E9C7C833F4FDA366E0477F

Agreed. That could be a pain to fix. We currently do the mapping after we extract the session ID (and we'll need the context to figure out the right uri parameter name). We'll have to change that order. Haven't looked into what impact that might have yet.
Comment 2 Mark Thomas 2010-05-16 17:47:35 UTC
Fixed in trunk. Will be in 7.0.0 onwards.