tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Parker <>
Subject sharing session cookies across sub-domains - how?
Date Wed, 30 Jan 2008 15:45:07 GMT

I am using several sub-domains that all point to the same app (they 
cause different content to be displayed, depending on the sub-domain).  
For example, I have:

I need the session data to be shared across these subdomains, so that 
when a user is clicking around the app, crossing across sub-domains, 
they won't lose the session state (e.g., if they're logged in, etc).

I understand that Tomcat uses session cookies to associate server 
session with the client request.  And I understand that the default 
behavior of this causes these session cookies to be specific to a 

My question:

How can I make the session cookies get written so that they are relevant 
to ALL sub-domains under the main domain.  I have read a few things that 
say that if you set the domain of the cookie to be "", it 
will be associated with all sub-domains of that primary domain.  But, 
not sure how to do this since tomcat has some built in way of setting 
these cookies...  I saw something with valves, but need more info.

Any help here, or suggestions for a different approach altogether for 
sharing session state across sub-domains, would be very much appreciated.


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message