ResponseCookies.Delete Not Deleting #565
Description
Hi All,
When signing out of our web application we're wanting to clear a cookie that's set during their use of the application. The weird thing is that
Response.Cookies.Delete("searchCriteria");
doesn't clear the cookie, but
Response.Cookies.Delete("searchCriteria", new CookieOptions() { Expires = DateTime.Now.AddDays(-1) });
does. If I set a break point right after the call to Delete()
, in both cases it looks like the expiration of the cookie is set to something significantly old (January 1 1970) - so my passing in Expires = ... doesn't do anything.
I looked at ResponseCookies.cs and can't really reason this out (but it's been a long day and maybe I'm just not seeing the issue). Anyways, I'd have thought we'd want the expiration (set way at the bottom of ResponseCookies.cs to make the cookie go bye bye.
Thanks,
Brian Eriksen