Time Zones and Cookies Expiration
Folks,
As far as I understand, browsers use UTC to check cookies for expiration. That allows to avoid the following situation. Suppose, a server wants to set a cookie with a lifetime of 2 hours. The server uses its own local time, but its in a different time zone 3 hours ahead w.r.t browser. Then the new cookie will be expired upon arrival.
So far, so good.
The MSDN reference page for HttpCookie.Expires property doesn't say anything about time zones and provides this example:
Code:
MyCookie.Expires = DateTime.Now.AddMinutes(10.0);
I was expecting something along the lines of
Code:
OurCookie.Expires = DateTime.Now.ToUniversalTime().AddMinutes(10.0);
Does the framework automatically convert to UTC ?
Any suggestion, insight or reference is really appreciated!
Best,
- Nick
p.s. Found this related thread: How do I set cookie expiration time in user local time?