示例#1
0
 /// <summary>
 /// 只清理redis的用户
 /// </summary>
 public virtual void EmptyCurrentRedis()
 {
     try
     {
         UserModel user = Current();
         RedisCacheUtils.Select(0);
         RedisCacheUtils.Remove(GrobalConfig.RedisUserTitle + user.UserId);
         RedisCacheUtils.Select(1);
         RedisCacheUtils.Remove(HttpContext.Current.Session.SessionID);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#2
0
        /// <summary>
        /// 删除登录信息
        /// </summary>
        /// <param name="userId"></param>
        public virtual void EmptyUser(string userId)
        {
            try
            {
                string userIdKey = GrobalConfig.RedisUserTitle + userId;

                RedisCacheUtils.Select(0);
                string otherSessionId = RedisCacheUtils.Get <string>(userIdKey);
                RedisCacheUtils.Remove(userIdKey);

                RedisCacheUtils.Select(1);
                RedisCacheUtils.Remove(otherSessionId);
                //todo:clear other session
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#3
0
 private void RedisDelClient(string clientSessionId)
 {
     RedisCacheUtils.Select(2);
     RedisCacheUtils.Remove(clientSessionId);
 }
示例#4
0
 private void RedisDelTicket(string ticket)
 {
     RedisCacheUtils.Select(3);
     RedisCacheUtils.Remove(ticket);
 }