Michael Conrad
Michael Conrad

Reputation: 180

Spring Boot is ignoring application.properties session timeout value

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

Upvotes: 1

Views: 638

Answers (1)

Michael Conrad
Michael Conrad

Reputation: 180

This was caused by Docker not picking up property file changes when rebuilding the container.

Upvotes: 0

Related Questions