here is the to add the cookie to the request

    HttpCookie cookie = new HttpCookie(myCookie);
    cookie.Expires = DateTime.Now.AddDays(30);
    cookie.Value = myValue;
    cookie.Domain = myDomain;
    cookie.HttpOnly = true;
    response.Cookies.Add(cookie);

Seems fine, until during a Sharepoint 2010 context.PostAuthenticateRequest event when i try to read the cookie

    HttpCookieCollection cookies = request.Cookies;
        HttpCookie tosCookie = cookies.Get(TOS_COOKIE_KEY_ACKNOWLEDGEMENT);
        tosCookie.Expires

i get the date 01/01/0001 when in the browser i see the cookie expiration date as 12/6/2012

1

There are 1 answers

1
Alexei Levenkov On BEST ANSWER

Yes, server does not know expiration time on incoming cookies.

Browser does not send expired cookies to server and does not in any way let server know what cookie expiration is.