Assuming you do not actually need persistent sessions, you can fix this by disabling persistent sessions in Tomcat.
You can do this by adding the following to your application's context.xml file (or adding it to the server's context.xml).
<Manager pathname="" />
For example, here is a context.xml file created automatically for a server in Spring Tools Suite:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
<!-- Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->
</Context>