Tech Off Post

Single Post Permalink

View Thread: Cookie Question
  • User profile image

    odujosh wrote:
    How would you figure out time zone of DateTime. How to adjust for GMT? I am curious about a more precise answer if anyone has one.

    That's the thing, by expressing the DateTime object in GMT time, you completely avoid things like time zone and summer and winter time.

    GMT time is completely neutral in that sense, and the DateTime format used by the cookie object takes advantage of that.

    The only thing is, because the cookie object lifetime is not expressed in Time To Live (TTL), you always have a descrepancy between server time and client time. You can try to compensate it by synchronizing things, but you always have the issue of how long a transaction will take or the execution time or the transport time.

    In that sense try to avoid expressing this explicitely yourself in the form of cookies, but use the session timeout mechanisms in stead provided by .NET and/or IIS

    Good luck,