Bug 46976 - tomcat 6 doesn't support configuration of domain parameter of generated session cookies
Summary: tomcat 6 doesn't support configuration of domain parameter of generated sessi...
Status: RESOLVED DUPLICATE of bug 48379
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 6.0.18
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-06 13:54 UTC by Brane F. Gracnar
Modified: 2009-12-11 08:48 UTC (History)
0 users



Attachments
This patch adds possibility to support for specifying domain parameter of generated session cookies. (2.72 KB, patch)
2009-04-06 13:54 UTC, Brane F. Gracnar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brane F. Gracnar 2009-04-06 13:54:07 UTC
Created attachment 23449 [details]
This patch adds possibility to support for specifying domain parameter of generated session cookies.

We needed subdomain session cookie support for our java webapp; currently
there is no way to configure cookie domain attribute in tomcat <= 6.0.18.

This patch adds this functionality. Cookie domain can be specified as Manager
property (default null == turned off) in conf/context.xml or on per webapp
context property (conf/<engine_name>/<vhost>/appname.xml or
META-INF/context.xml).

--- snip ---
<Context override="true">
        <Manager cookieDomain=".example.org" />
</Context>
--- snip ---

Webapp will then issue session cookies in the following form:

JSESSIONID=D29B85A0D5E3AADA7DAA2B8DE660B0B3; Domain=.example.org; Path=/

Browser will send this cookie to sites www.example.org, subsite.example.org,
etc...

This functionality is already implemented in Resin and Jetty.

How to use/apply:
svn co http://svn.apache.org/repos/asf/tomcat/tc6.0.x/tags/TOMCAT_6_0_18
cd TOMCAT_6_0_18
patch -p0 < /path/to/tomcat-6.0.18-subdomain-session-cookie.patch
ant download
ant

Best regards, Brane
Comment 1 Mark Thomas 2009-12-11 08:48:58 UTC
Bug 48379 has a better patch for this.

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