[Mono-dev] Patch for CookieContainer.SetCookies
tom.philpot at logos.com
Mon Jan 18 18:34:25 EST 2010
Oh, and these patches are MIT/X11 licensed.
On Jan 18, 2010, at 3:31 PM, Tom Philpot wrote:
> The current implementation of CookieContainer.SetCookies does not handle the case where a cookie contains an "expires=..." attribute.
> As documented on MSDN here: http://msdn.microsoft.com/en-us/library/aa384321%28VS.85%29.aspx the "Set-Cookie:" header expires attribute uses the following format: DAY, DD-MMM-YYYY HH:MM:SS GMT
> The current version of SetCookies simply does a split on ',' in the header which totally causes the CookieContainer to choke when the expires attribute is set as MS recommends.
> Also, the Add (Cookie) method of CookieContainer does not clone all the properties of the incoming cookie before adding it to the collection. Using SetCookies(Uri, string) should clone all the properties, so that is fixes as well in the patch and a test is added in the test cases.
> I believe this makes the behavior of CookieContainer more "bug-compatible" with .NET.
> Please review the patch and the test cases.
More information about the Mono-devel-list