spring session设置过期时间

 

@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 60)

 

这个注解添加到启动类上,则session的过期时间为60秒

 

参考资料:

https://docs.spring.io/spring-session/reference/guides/boot-redis.html

https://developpaper.com/spring-redis-session-custom-key-and-expiration-time/

posted @ 2022-05-04 13:47  jamstack  阅读(1105)  评论(0编辑  收藏  举报