存取cookies
Posted 行走在0和1之间
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了存取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(); ;
以上是关于存取cookies的主要内容,如果未能解决你的问题,请参考以下文章