Response.Cookies["Name"].Value = "test";
DateTime expiresDateTime = DateTime.Now.AddDays(1);
Response.Cookies["Name"].Expires = new DateTime(expiresDateTime.Year, expiresDateTime.Month, expiresDateTime.Day);
if (Request.Cookies["Name"] != null)
{
Response.Write(Request.Cookies["Name"].Value);
}设置cookie当日过期
最新推荐文章于 2021-09-29 11:56:43 发布
本文介绍如何在ASP.NET应用程序中设置和读取Cookies。通过示例代码展示了设置Cookies的有效期并读取Cookies值的方法。
2462

被折叠的 条评论
为什么被折叠?



