Tech Off Post

Single Post Permalink

View Thread: Cookie Question
  • User profile image

    Yeah it seems to be a situation of do what I say not as I do (from documentation):

    Property Value

    The time of day (on the client) at which the cookie expires.

    Then they turn around show:

    DateTime dt = DateTime.Now;
    TimeSpan ts = new TimeSpan(0,0,10,0);

    MyCookie.Expires = dt.Add(ts);

    DateTime.Now being the time on the server. So the right hand isn't talking to the left hand:)

    Without building a TimeZone property into the user profile or defaulting to some timezone how do you figure out the clients timezone. Is there some javascript trick I should be aware of Tongue Out

    So which is right? The text or the code?