[Mono-dev] Patch for CookieContainer.SetCookies

Sebastien Pouliot sebastien at ximian.com
Tue Jan 19 08:50:33 EST 2010

Hello Tom,

On Mon, 2010-01-18 at 15:31 -0800, 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,
> 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.

Great, I'll merge it with my local changes today (there are still more
issues than that) and try them (on mono and moonlight).

Can I assume the diff are against HEAD ? (the code is a bit different on
2-6 and 2-4 due to 1.x support and compiler differences).

> Please review the patch and the test cases.

Please have a look at http://www.mono-project.com/Coding_Guidelines

In particular avoid unneeded changes (like space additions/removal),
code style changes (even more when they are against conventions) and the
place of () [] after method / variables names.


More information about the Mono-devel-list mailing list