The cookie with the expiration of DateTime.MinValue (1/1/0001) expires at the end of the session. This is the default expiration date for the cookie in asp.net.
You can force the cookie to be removed from the client by setting the expiration date to something earlier than "now" (DateTime.Now.AddDays (-1d)), in which case it will be deleted when the client hits.
If we had null types when the HttpCookie was encoded, my hunch is that the null date will be equal to the session-based cookie, and everything else will be converted to expiration, but that is not the case.
andleer
source share