简体   繁体   中英

ASP.Net C# create a cookie that expires at midnight

I know how to add days to a cookie but I am unsure how I would create a cookie that expires at midnight on the current day using ASP.Net and C#. Thanks in advance for any help.

这应该做到这一点:

Response.Cookies["Cookie_SessionID"].Expires = DateTime.Today.AddDays(1);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM