Trying to cluster Lucee J2EE sessions with jvmRoute enabled

Hi, Lucee gurus! I’m trying to set up shared sessions between Lucee servers so that sessions aren’t lost if users have to fail over from one Lucee to another. I’m anticipating running into a problem with my JSESSIONID cookies.

We use JEE/J2EE sessions, so Tomcat is responsible for generating the JSESSIONID cookies that are used to identify sessions. Those cookie values look like [hex session identifier].[server name], which allows our load balancer to maintain session stickiness. (The appending of the server name is enabled by the “jvmRoute” attribute to in the server.xml.) When a worker goes down, and the request is routed to another worker by the load balancer, an entirely new JSESSIONID cookie is generated, with a different session identifier. So, even with an external session store, I don’t see how the “new” worker would be able to find the session that was originated by the old worker. It seems like the answer might be to turn on Tomcat clustering, so that each Tomcat knows about the sessions of all of the others, but I’m trying to avoid that if possible because complexity.

Is it possible to cluster Lucee sessions while using JEE sessions, jvmRoute, and not using Tomcat session clustering?

Did you try using shared external session storage?

I’m working on setting that up, using Redis because database session stored doesn’t work with JEE sessions. I guess I won’t know if it works until I try it, but I was hoping someone who’s done it already could give me a vote of confidence.

is there a specific bug in jira for that problem?

Not that I know of. It may even be by design. I’m not sure of the reason.