SessionObj getSession() { var obj = client.KGet <SessionObj>(SessionId); if (obj == null) { return(null); } return(obj); }
public ApiSessionData GetSession(string user) { var client = new RedisClient(3); var v = client.KGet <ApiSessionData>(user); if (v != null) { client.KSetEntryIn(user, TimeSpan.FromMinutes(20)); } return(v); }