public static void setToken_dp(user_info user) { string token = RsaUtil.RSAEncryption(JsonUtil.toJson(user)); DateTime dateTime = DateTime.Now.AddHours(VALID_NUM); HttpRuntime.Cache.Insert("scheduling_token_dp", token, null, dateTime, TimeSpan.Zero); }
public static user_info getToken() { try { string token = HttpRuntime.Cache.Get("scheduling_token").ToString(); return(JsonUtil.toObject <user_info>(RsaUtil.RSADecrypt(token))); } catch { return(null); } }