码迷,mamicode.com
首页 > 其他好文 > 详细

存取cookies

时间:2017-08-16 11:39:48      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:img   http   put   pen   font   取出   encode   obj   nbsp   

保存:
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

标签:img   http   put   pen   font   取出   encode   obj   nbsp   

原文地址:http://www.cnblogs.com/zwyAndDong/p/7371980.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!