HttpApplication app = sender as HttpApplication;
HttpContext context = app.Context;
var curRequest = app.Request;
var cookies = app.Request.Cookies;
//新增
HttpCookie cookie = new HttpCookie("wxtoken");
cookie.Value = wxtoken;
cookie.Expires = DateTime.Now.AddDays(2);//有效期
context.Response.Cookies.Add(cookie);
//取
var s=cookies["wxtoken"]
Cookies用法
最新推荐文章于 2024-04-18 07:00:00 发布