In Tomcat there is a well known configuration option in conf/context.xml
to disable session persistence:
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<Manager pathname="" />
When uncommented as shown here, the applied implementation of org.apache.catalina.Manager
(e.g. org.apache.catalina.session.StandardManager
) does not have a pathname
to tell it where to store sessions to the disk, and thus it does not write session files to disk (e.g. on shutdown), which is what we want.
In other words, this disables the standard Tomcat feature to sustain sessions through server restart.
How can the same be achieved in Spring Boot with embedded Tomcat?
Perhaps the Manager object can somehow be obtained to set the property pathname to null?