Adds the contents of a System.Net.CookieCollection to the System.Net.CookieContainer for a particular URI.
- uri
- The URI of the System.Net.CookieCollection to be added to the System.Net.CookieContainer.
- cookies
- The System.Net.CookieCollection to be added to the System.Net.CookieContainer.
If you add a System.Net.Cookie instance for just one specific host, do not set the Cookie.Domain property of the System.Net.Cookie instance. This is set automatically, based on the URI.
If your URI corresponds to your local domain and sends to all the hosts on the local domain, set the System.Net.Cookie Cookie.Domain property equal to ".local". Otherwise, make sure it matches the host name used in the URI.
If CookieContainer.Count equals CookieContainer.Capacity, one or more System.Net.Cookie instances is removed from the container before adding the cookie parameter. Enough System.Net.Cookie instances are removed to bring CookieContainer.Count below CookieContainer.Capacity as follows: if there are expired instances in scope they are cleaned up. If not, then the least recently used System.Net.CookieCollection is found and removed from the container.