Spring Boot is ignoring application.properties session timeout value

Viewed 33

I'm trying to get Spring Session timeout changed to a longer default value and also to have the cookie be persistent instead of session only. I'm using spring-session-jdbc for session storage.

I've put into the application.properties file the following:

#Distributed Session Storage for use by stateless apps
spring.session.store-type=jdbc
spring.session.jdbc.initialize-schema=always

server.servlet.session.timeout=1d
server.servlet.session.cookie.max-age=1d
server.servlet.session.cookie.same-site=strict

Other settings in the application.properties file are applied as expected.

It only seems to be the session and cookie settings that aren't being applied.

This is a Spring Boot Jar run via java -jar. The database is MariaDB and sessions are created and managed correctly, but I can't seem to change the cookie or timeout settings.

Help appreciated. -Michael/NewsRx

0 Answers
Related