Provides a container for a collection of CookieCollection objects.
Assembly: System (in System.dll)
Initializes a new instance of theclass.
Initializes a new instance of the Cookie instances that the container can hold.class with a specified value for the number of
|CookieContainer(Int32, Int32, Int32)|
Initializes a new instance of theclass with specific properties.
Gets and sets the number of Cookie instances that a can hold.
Gets the number of Cookie instances that a currently holds.
Represents the maximum allowed length of a Cookie.
Gets and sets the number of Cookie instances that a can hold per domain.
Adds the contents of a CookieCollection to the .
Adds a Cookie to the for a particular URI.
Adds the contents of a CookieCollection to the for a particular URI.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Gets the HTTP cookie header that contains the HTTP cookies that represent the Cookie instances that are associated with a specific URI.
Serves as the default hash function. (Inherited from Object.)
Adds Cookie instances for one or more cookies from an HTTP cookie header to the for a specific URI.
Returns a string that represents the current object.(Inherited from Object.)
Represents the default maximum size, in bytes, of the Cookie instances that the can hold. This field is constant.
Represents the default maximum number of Cookie instances that the can hold. This field is constant.
Represents the default maximum number of Cookie instances that the can reference per domain. This field is constant.
A Cookie class, and which is accessed in a database-like manner. The has a capacity limit that is set when the container is created or changed by a property.is a data structure that provides storage for instances of the
An instance of the Cookie class is added to the container based on its originating URI. It is added to an internal CookieCollection associated with the URI. A Cookie is retrieved from the container based on the URI as a CookieCollection, or as a string that can be used to submit HTTP WebRequests.
The Capacity, MaxCookieSize, and PerDomainCapacity. These values have the default settings of 300, 4096, and 20 respectively. When a Cookie is added to the container, these properties are used to determine whether a Cookie already contained in the should be discarded to make room for the new one. The keeps track of each addition to ensure that neither the Capacity nor the PerDomainCapacity limits are exceeded. If one or both are exceeded, then Cookie instances held by the are removed. First, any expired Cookie is removed. If further capacity must be recaptured, then the least-recently used CookieCollection is purged.has three properties that govern the volume of the content of the container:
Available since 8
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.