Tomcat feature
This is a pure tomcat feature, independent of how you start it. From the docs:
Disable Session Persistence
As documented above, every web application by default has standard
manager implementation configured, and it performs session persistence
across restarts. To disable this persistence feature, create a Context
configuration file for your web application and add the following
element there:
<Manager pathname="" />
Example of disabling session persistence
For example, in the META-INF
folder of your web app, add a context.xml
file as shown below.
<!-- 'context.xml' file in 'META-INF' folder of your web app -->
<Context>
<Manager pathname="" />
</Context>
You should be able to add this into your project in your IDE. You may need to explicitly add the META-INF
folder if one is not already configured within your project. Here is a screen shot in IntelliJ 2017 after adding the folder and file.
