HttpCookie.Expire Affects Time Zone?

I am trying to write cookies from my website and I am trying to figure out what the consequences are of the time limits on the HttpCookie.Expire property. Do I have to go through DateTime.Now.AddDays(1)or DateTime.UtcNow.AddDays(1)or users time zone plus day?

+5
source share
1 answer

If you use local time, .NET will automatically convert it to GMT when it is output to the client.

So it does not matter for the cookie, but I suggest you always work with UTC, so at least you can assume that in your data the time zone offset is always 0.

+11
source

All Articles