存取cookies

保存:
Response.Cookies["OpenID"].Value = wxobj.openid;
Response.Cookies["NickName"].Value = HttpUtility.UrlEncode(wxobj.nickname);
Response.Cookies["headimgurl"].Value = headimgurl;
 
取出 if (HttpContext.Current.Request.Cookies["NickName"] != null)
{
AcceptName = HttpUtility.UrlDecode(HttpContext.Current.Request.Cookies["NickName"].Value.ToString());
// AcceptName = HttpContext.Current.Request.Cookies["NickName"].Value.ToString();
}
if (HttpContext.Current.Request.Cookies["OpenID"] != null)
{
userName = HttpContext.Current.Request.Cookies["OpenID"].Value.ToString();
}
 
HttpContext.Current.Response.Cookies["u"]["p"] = phone;
string LoginName = HttpContext.Current.Request.Cookies["u"]["p"].ToString(); ;
原文地址:https://www.cnblogs.com/zwyAndDong/p/7371980.html