I am learning Tomcat session control and I have 2 workers with sticky_session=1. But I want to remove stickiness to a particular worker yet maintain the session for users. I found the following statement in Tomcat doc and it says sticky_session can be False yet session can be shared across multiple instances. But I'm not quite sure what this Session Manager is exactly about and how to set it up. Could someone please elaborate this or point me to the corresponding doc if there is any?

sticky_session specifies whether requests with SESSION ID's should be routed back to the same Tomcat worker. You can set sticky_session to False when Tomcat is using a Session Manager which can persist session data across multiple instances of Tomcat. By default sticky_session is set to True.


The page you should be looking at is the Cluster Howto. Configuring the jk connectors to load balance across two Tomcats without sticky sessions on its own isn't enough, since it doesn't cause the session object to be replicated across both Tomcats. Instead, it will potentially send your user to a different Tomcat on different requests, losing session state. Clustering is what you need to make sure the user's session data will be available on both Tomcat instances.


I found the config manager reference here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.