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

前端 未结 4 867
予麋鹿
予麋鹿 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:47

    If you just want to do one time thing in debugging process, you can just log into redis_cli and flush all Redis keys.

    $ redis-cli
    127.0.0.1:6379> KEYS *
    1) "spring:session:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:bbb"
    2) "spring:session:expirations:1558782600000"
    3) "spring:session:expirations:1558783140000"
    4) "spring:session:sessions:expires:953146bf-7300-4394-bbf0-bf606ff6b326"
    5) "spring:session:expirations:1558782540000"
    6) "spring:session:sessions:953146bf-7300-4394-bbf0-bf606ff6b326"
    127.0.0.1:6379> FLUSHALL
    OK
    127.0.0.1:6379> KEYS *
    (empty list or set)
    127.0.0.1:6379>
    

提交回复
热议问题