cookie读写
HttpCookie cookie = new HttpCookie("guid"); //创建
cookie.Values["id"] = “123456789”; //将“123456789”写入id
HttpContext.Current.Response.AppendCookie(cookie); //保存
HttpCookie cookie = HttpContext.Current.Request.Cookies[“guid”]; //读取
string id = cookie.Values["id"].ToString(); //id="123456789"
cookie.Expires 可以设置过期时间,一般不进行设置默认关闭浏览器后失效
本文来自博客园,作者:zwbsoft,转载请注明原文链接:https://www.cnblogs.com/zwbsoft/p/16044021.html
电话微信:13514280351