这是将cookie添加到请求中
HttpCookie cookie = new HttpCookie(myCookie);
cookie.Expires = DateTime.Now.AddDays(30);
cookie.Value = myValue;
cookie.Domain = myDomain;
cookie.HttpOnly = true;
response.Cookies.Add(cookie);
似乎很好,直到在 Sharepoint 2010 context.PostAuthenticateRequest 事件期间,当我尝试读取 cookie
HttpCookieCollection cookies = request.Cookies;
HttpCookie tosCookie = cookies.Get(TOS_COOKIE_KEY_ACKNOWLEDGEMENT);
tosCookie.Expires
当我在浏览器中看到 cookie 过期日期为 12/6/2012 时,我得到日期 01/01/0001