System.Net.CookieContainer.Add Method

Adds a System.Net.Cookie to a System.Net.CookieContainer. This method uses the domain from the System.Net.Cookie to determine which domain collection to associate the System.Net.Cookie with.

Syntax

public void Add (Cookie cookie)

Parameters

cookie
The System.Net.Cookie to be added to the System.Net.CookieContainer.

Remarks

If the CookieContainer.Count property equals or exceeds the CookieContainer.Capacity property, one or more System.Net.Cookie instances are 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 the given scope, they are cleaned up. If not, then the least recently used System.Net.CookieCollection is found and removed from the container.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0