According to the documentation of Spring Boot, session timeout can be configured by setting
server.servlet.session.timeout= 300s
in
A possible cause for this problem might be using @EnableRedisHttpSession. As explained in this answer:
By using @EnableRedisHttpSession you are telling Spring Boot that you want to take complete control over the configuration of Redis-based HTTP sessions. As a result, its auto-configuration backs off and server.servlet.session.timeout has no effect. If you want to use server.servlet.session.timeout then you should remove @EnableRedisHttpSession. Alternatively, if you want to use @EnableRedisHttpSession then you should use the maxInactiveIntervalInSeconds attribute to configure the session timeout.
Hope this helps someone.