Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hostname in tomcat cookies

Our Tomcat creates session IDs with the following format:

jsessionid=a345465820fce654354646ae.(server-name);

Is it possible to configure it so that server-name is not part of session id?

like image 833
j_maly Avatar asked Nov 11 '22 21:11

j_maly


1 Answers

I think you need to implement your own session manager to change the format of JSESSIONID. I am not sure what you want to achieve but this question might be of interest, you also have a link to the session manager HOW-TO at Tomcat.

How to generate custom JSESSIONID, based on some hash of user's data in order to replicate session

However, if you have an Apache server in front of your Tomcat it might be easier to create your own cookie and use that instead of JSESSIONID. You can do this by using the mod_header and there is an example of this in the mod_proxy_balancer documentation.

Hope it helps you forward.

like image 126
Qben Avatar answered Nov 14 '22 23:11

Qben