添加COOKIE

 

 HttpCookie userinfoCookie = new HttpCookie("userinfo");

JObject o = new JObject();//JObject是Newtonsoft.Json.Linq中的对象

o["userid"] = userDB.UserID.ToString();

o["nickname"] = userDB.NickName;
o["avatar"] = userDB.ImageUrl;
userinfoCookie.Value = o.ToString();
Response.Cookies.Add(userinfoCookie);

posted on 2019-09-03 10:58  newlives  阅读(241)  评论(0编辑  收藏  举报