tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: using Servlet Filter to rewrite domain of JSESSIONID cookie?
Date Fri, 02 Jul 2010 08:45:53 GMT
Pid wrote:
> On 02/07/2010 08:31, André Warnier wrote:
>> Christopher Schultz wrote:
>>> Hash: SHA1
>>> Nikita,
>>> On 7/1/2010 6:37 PM, Nikita Tovstoles wrote:
>>>> I borrowed "sub-domain" from Google Analytics terminology. I have one
>>>> server, running one tomcat instance with one virtual host. That host is
>>>> running one app - a JS/html widget that is embedded on multiple sites.
>>>> We need to track usage per-deployment (per site embedding the wiget).
>>>> For
>>>> (google) analytics purposes, the easiest way to do so is to have a
>>>> different
>>>> (sub)domain per deployment. So the same tomcat instance is responding to
>>>> requests for,, etc.
>>>> a user may interact with 2 widget deployed on 2 different sites (and
>>>> thus
>>>> served from different (sub)domains) within 30 minutes. It is for this
>>>> case
>>>> that we want user to share the same HttpSession:
>>>> - go to some site A where our widget is deployed at
>>>> - go to some other site B where our widget is deployed at
>>>> - reuse the same JSESSIONID because its' domain is set to ""
>>> This sounds like a job for a non-JSESSIONID cookie that is created from
>>> your own code.
>> +1
>> But I am still lost as to what you are calling "sites" and "subdomains"
>> and "deployed at".
>> If I follow the explanation above, you have something like this :
>> <Host name="localhost" appBase="webapps">
>>  <Alias></Alias>
>>  <Alias></Alias>
>>  <Alias></Alias>
>>  <Alias></Alias>
>> ...
>> </Host>
> You can omit the aliases and just rely on the defaultHost setting in
> Engine to route all requests to a specific Host.
I know, but I am trying to get a grip of what the OP means by sites etc..
This is to try to figure out if, apart from modifying the domain of the JSESSIONID cookie

(which seems difficult), there is a better solution to the OP's underlying issue (Google 
Maybe this thing can be solved by a simple servlet filter, or UrlRewriteFilter, or some 
dispatching servlet, or having the application do a getHostName() or ..

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message