Springboot app session timeout

后端 未结 5 1311
北荒
北荒 2021-01-04 11:12

I have created a SpringBoot MVC/Security app 1.2.2.RELEASE and my application.properties contains server settings like

#Tomcat port and contextPath details
s         


        
5条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-04 11:32

    I'm not sure what this server.session.timeout is for because when I set it to a specific number, and monitor the session creation, the session expiry does not get changed.

    I'm using spring session and redis integration, in my case, I need to set the maxInactiveIntervalInSeconds to be like 120(seconds), this can be done thru redisHttpSessionConfiguration.

    And then if I go to redis to look for the session, I can see it's expiry is changed to 120 seconds and session timeout works.

    One suggestion of mine would be that try to find out if you can configure the session's maxInactiveIntervalInSeconds(or similar) either programmatically or in the property file and monitor session changes.

提交回复
热议问题