You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ya...@peoplesoft.com on 2004/07/03 06:06:50 UTC
question on tomcat's JSESSIONID
Hi,
I have 2 questions regarding tomcat:
1- I am wondering if it is possible to rename the JSESSIONID cookie to
something else. I am interseted in renaming it <host>_<port>_JSESSIONID
this way JSESSION ids generated by webservers on the same domain
(domain.com) will not conflict with each other. (I have a special setup
with a portal webserver which relays cookies to other webservers in the
same domain)
I know this can be done with WebLogic : you can customize the name of the
JSESSIONID cookie in weblogic.xml. Is it possible to do this with tomcat?
2- An alternate solution for me would be to be able to have a tomcat
server accept a JSESSIONID cookie generated by another tomcat webserver.
In other words is there a way to reuse JSESSIONID cookies with tomcat. I
tried this simple test case: I overwrote the HelloWorld servlet with the
code I attached (I attached the java and the class in the zip file). This
simply creates a session if one does not already exist and prints out info
about that session. I copied the class file to 2 tomcat webservers on the
same host. Then with a clean browser (cookies deleted ) I targetted the
servlet on the first server which generated a JSESSIONID. Then I targetted
the servlet on the second server which failed to accept that cookie and
reuse to create an httpsession with the same id.
I know that WebSphere allows you to reuse JSESSIONID cookies. I think
resin does too. Is there a config setting for tomcat to enable this
'reuse' feature?
Please reply to yassine_hinnach@peoplesoft.com and
chris_phillips@peoplesoft.com
Thanks for your help,
Yassine
Re: question on tomcat's JSESSIONID
Posted by Michael Echerer <me...@tngtech.com>.
Yassine_Hinnach@peoplesoft.com wrote:
>
> Hi,
> I have 2 questions regarding tomcat:
>
> 1- I am wondering if it is possible to rename the JSESSIONID cookie to
> something else. I am interseted in renaming it <host>_<port>_JSESSIONID
> this way JSESSION ids generated by webservers on the same domain
> (domain.com) will not conflict with each other. (I have a special setup
> with a portal webserver which relays cookies to other webservers in the
> same domain)
> I know this can be done with WebLogic : you can customize the name of
> the JSESSIONID cookie in weblogic.xml. Is it possible to do this with
> tomcat?
Of course you could change the source. I doubt this cookie name can be
configured.
Due to cookie domain conflict with the JSESSIONID of two servers we once
patched the Tomcat binaries directly.
Just search in \server\lib jars for classes (as far as I remember there
are only 2-3 .class files that need to be patched) with the string
JSESSIONID, take a hex editor and set it to JSESS123ID for example. Put
the patched class files back into the jars etc.
Make sure that the string has the same length as the original cookie name!
Kind of a hack, but it works!
Greetings
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org