一、Cookie
设置 cookie
HttpCookie cookie = new HttpCookie(name);
cookie.Value = user.UserID.ToString();
Response.Cookies.Add(cookie);
读取cookie
System.Web.HttpContext.Current.Request.Cookies[name].Value
二、Session
设置session
HttpContext.Current.Session.Add(name, value);
根据session名获取session对象
HttpContext.Current.Session[name];