I have a Spring Boot application and I can't seem to get my login session to last very long. I'm setting the following in application.properties
:
spring.session.timeout = 180d
server.servlet.session.timeout = 180d
I have a couple of questions:
• What duration suffixes are allowed when specifying spring.session.timeout
and server.servlet.session.timeout
? I can't find this documented anywhere, just a note in these docs saying “If a duration suffix is not specified, seconds are used,” implying other durations are possible.
• Do I need to include spring-session
in my POM? I don't care about session clustering or the stateful REST API support, and I want to avoid more startup time and configuration. I certainly don’t want to configure more persistence.
My primary concern is keeping me logged in to the website (ideally indefinitely).
I'm using Spring Boot 2.3.0-RELEASE.