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

阅读更多
原因是配置了:
   这一行。

参考官网文章:
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.


解决办法:
去掉配置:

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

你可能感兴趣的:(redis,spring,httpsession,session)