Skip to content

Allow persistent sessions across restarts of embedded servlet containers #2490

@mus65

Description

@mus65

When restarting an application with an embedded Tomcat, Tomcat is not able to restore the sessions since Spring generates a new temporary directory on every start (e.g. /tmp/tomcat.5990562997404648887.8080 on my linux machine). However, restoring the sessions would be really useful, especially during development.

I figured out a way to work around this by setting server.tomcat.basedir=/tmp. However, this is inconvenient since it has to be changed depending on the operating system.

IMHO Spring Boot should not generate a new random temporary directory on each start, but use something static to make persistent sessions work out-of-the-box. If this is not possible for some reason, this should at least be documented since it took me quite some time to figure out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions