Exemplo n.º 1
0
 public static void Set(InfoModel value)
 {
     if (value == null)
     {
         HttpContext.Current.Response.Cookies[PARAM_KEY].Expires = DateTime.Now.AddYears(-1);
     }
     else
     {
         HttpContext.Current.Response.Cookies.Add(new HttpCookie(PARAM_KEY, Convert.ToBase64String(Encoding.UTF8.GetBytes(EncryptUtil.CryptXOR(Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonUtil.ToJson(value))), CRYPTXOR_KEY)))));
     }
 }