/// <summary> /// 在线用户SessionId列表 /// </summary> /// <returns></returns> public IList <string> GetKeyAll() { return(RedisHash.SearchKeys("session_" + "*")); }
/// <summary> /// 用户数量 /// </summary> /// <returns></returns> public int Count() { return(RedisHash.SearchKeys("session_" + "*").Count); }
/// <summary> /// 删除session /// 7.25 zl /// </summary> /// <returns></returns> public static bool ClearKey(string sessionId) { return(RedisHash.Remove(sessionId));//删除该hash键 }
/// <summary> /// 判断指定的用户是否存在(通过userid,即cookieKey)是否存在 /// </summary> /// <param name="CookieKey">用户的userID</param> /// <returns>存在true,不存在false</returns> public bool ContainsKey(string CookieKey) { return(RedisHash.ContainsKey(CookieKey)); }
/// <summary> /// 清空Sesion /// </summary> public bool Clear() { return(RedisHash.Remove(SessionId));//删除该hash键 }