mono/mono — pull request #420 by martinpotter (2012-08-06 04:49:34+00:00)
Title: Bug #6405: If a CookieContainer is set, always use its cookies.

Previously, cookies from the WebHeaderCollection and CookieContainer were sent. This also fixes a bug with ServicePoint sending duplicate cookies when SendRequestHeaders is called more than once:

* WebConnection.InitConnection
* HttpWebRequest.SetWriteStream
* HttpWebRequest. SendRequestHeaders
* WebConnectionStream.WriteRequest
* HttpWebRequest.SendRequestHeaders

Replacing the cookie header value in the WebHeaderCollection with the cookies stored in the CookieContainer also matches the behavior of Microsoft's .NET implementation.