Cannot set session cookie max age in Kubernetes Spring Boot app Cannot set session cookie max age in Kubernetes Spring Boot app kubernetes kubernetes

Cannot set session cookie max age in Kubernetes Spring Boot app


OK, it turned out that the session is being managed by Spring due to spring.session.store-type being set to redis in the integration environments. It's none in my local build, which means Tomcat manages the session instead. Sorry, I didn't mean to obfuscate that. I just didn't know what to look for. The default session cookie name for a Spring-managed session is SESSION, while for Tomcat, it's JSESSIONID, so I was at least right about that being the key to the mystery.

There don't seem to be properties for configuring the Spring session cookie, but I found this explanation about how to configure it in code: Spring Session - Custom Cookie