【问题标题】:How to set Redis Http Session Timout to Unlimited in Spring如何在 Spring 中将 Redis Http 会话超时设置为无限制
【发布时间】:2020-07-15 19:23:53
【问题描述】:

我想在春季将 redis 会话超时设置为无限制。
@EnableRedisHttpSession ma​​xInactiveIntervalInSeconds 默认为 1800 秒,我在文档中看到
@ 987654321@

因此将其设置为 -1(无限制)似乎是不可能的。
仅供参考:它已经在 tomcat 中设置为 web.xml 中的 -1 并且工作正常,直到会话更改为 Redis Http 会话管理。
谢谢

【问题讨论】:

    标签: java spring redis


    【解决方案1】:

    我尝试将 -1 作为 maxInactiveIntervalInSeconds 并且效果很好。 会话是无限的。 但是,如果有人考虑使用它,它可能会导致 redis 中的内存泄漏,因为会话永远不会过期(尤其是对于匿名会话)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-30
      • 2012-10-19
      • 2012-08-18
      • 1970-01-01
      • 2016-08-16
      • 1970-01-01
      • 2014-10-20
      相关资源
      最近更新 更多