【问题标题】:Spring Boot - Redis persistence tokenSpring Boot - Redis 持久性令牌
【发布时间】:2016-02-16 17:59:27
【问题描述】:

我有一个使用这种方案的项目:

  • 春季启动
  • Spring 安全性
  • Redis

除会话时间外,一切正常。 我想将令牌永久保存在 Redis 中。令牌必须没有过期我该怎么办? 这和我的 HttpSessionConfig 的配置:

@Configuration
@EnableRedisHttpSession
public class HttpSessionConfig {

    @Bean
    public HttpSessionEventPublisher httpSessionEventPublisher() {
            return new HttpSessionEventPublisher();
    }   
}

【问题讨论】:

    标签: spring-security redis spring-boot


    【解决方案1】:

    Rwinch 先生建议使用此命令:

    EnableRedisHttpSession (MaxInactiveIntervalInSeconds = Integer.MAX_VALUE)
    

    这样,会话将在 68 年后到期:)

    【讨论】:

      猜你喜欢
      • 2017-06-11
      • 2017-07-15
      • 1970-01-01
      • 2014-01-17
      • 2016-05-16
      • 2020-02-10
      • 2018-04-04
      • 2017-01-01
      • 1970-01-01
      相关资源
      最近更新 更多