public WxOperatorModel GetCurrent() { string cookieString = string.Empty; StaticHttpContext.Current.Request.Cookies.TryGetValue(WeixinAppKey, out cookieString); if (!string.IsNullOrEmpty(cookieString)) { WxOperatorModel wxOperatorModel = new WxOperatorModel(); wxOperatorModel = DESEncrypt.Decrypt(cookieString).ToObject <WxOperatorModel>(); return(wxOperatorModel); } else { return(null); } }
public void AddCurrent(WxOperatorModel wxOperatorModel) { StaticHttpContext.Current.Response.Cookies.Append(WeixinAppKey, DESEncrypt.Encrypt(wxOperatorModel.ToJson())); }