ASP.Net HttpCookie Expiration

时间:2015-09-14 02:58:24

标签: c# asp.net asp.net-mvc httpcookie

如果您将Cookie的到期时间设置为DateTime.Now.AddDays(-1),它什么时候会过期?它表明到期日是昨天。这是代码:

var rememberMeCookie = new HttpCookie("remember_me");
rememberMeCookie.Expires =  DateTime.Now.AddDays(-1);

0 个答案:

没有答案