spring-boot redis : How to invalidate all sessions of a user?

前端 未结 4 880
予麋鹿
予麋鹿 2021-02-01 08:04

I\'m new to redis. I\'ve followed this tutorial to use HttpSession with redis.

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

<
4条回答
  •  醉酒成梦
    2021-02-01 08:37

    Try this

    usersSessions.forEach((session) -> {        
            sessionRegistry.delete(session.getId());
      });
    

提交回复
热议问题