标签:取值 汉字 bag var ons util put time role
var cookieValue = string.Format("{0}&{1}&{2}", user.Id, HttpUtility.UrlEncode(user.CompanyName), user.RoleId);
HttpCookie Cookie = new HttpCookie(Constant.Manager, cookieValue);
Cookie.Expires = DateTime.Now.AddHours(2);
Response.Cookies.Add(Cookie);
Response.Cookies[Constant.Manager].Expires = DateTime.Now.AddDays(-1);
var cookie = Request.Cookies[Constant.Manager];
if (cookie == null)
{
return View("login");
}
ViewBag.CompanyName = HttpUtility.UrlDecode(cookie.Value.Split(‘&‘)[1]);
标签:取值 汉字 bag var ons util put time role
原文地址:https://www.cnblogs.com/kikyoqiang/p/12812194.html