コード例 #1
0
 public void SetValue <T>(T value, string key)
 {
     if (cookie != null && !string.IsNullOrEmpty(cookie.Value))
     {
         MemcacheHelper.Set(HttpContext.Current.Response.Cookies["MemcacheSessionId"].Value + "$" + key, SerializerHelper.SerializerToString(value));
     }
     else
     {
         HttpCookie cookie1   = new HttpCookie("MemcacheSessionId");
         string     SessionId = cookie1.Value = Guid.NewGuid().ToString();
         HttpContext.Current.Response.Cookies.Add(cookie1);
         MemcacheHelper.Set(SessionId + "$" + key, SerializerHelper.SerializerToString(value));
     }
 }