`
a418040445
  • 浏览: 25390 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

使用spring session redis实现共享session之后,httpsession监听失效

阅读更多
原因是配置了:
<util:constant static-field="org.springframework.session.data.redis.config.ConfigureRedisAction.NO_OP"/>
   这一行。

参考官网文章:
https://docs.spring.io/spring-session/docs/1.1.0.M1/reference/html5/#httpsession-httpsessionlistener

看到这样的一段:
引用
If you are using @EnableRedisHttpSession the SessionMessageListener and enabling the necessary Redis Keyspace events is done automatically. However, in a secured Redis enviornment the config command is disabled. This means that Spring Session cannot configure Redis Keyspace events for you. To disable the automatic configuration add ConfigureRedisAction.NO_OP as a bean.


解决办法:
去掉配置:
<util:constant static-field="org.springframework.session.data.redis.config.ConfigureRedisAction.NO_OP"/>

如果还不行,那就需要开启redis的key失效事件监听。
参考文章:http://blog.csdn.net/aeroleo/article/details/77011839
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics