System.Net.CookieContainer Members

The members of System.Net.CookieContainer are listed below.

See Also: Inherited members from System.Object

Public Constructors

Initializes a new instance of the System.Net.CookieContainer class.

Initializes a new instance of the System.Net.CookieContainer class with a specified value for the number of System.Net.Cookie instances that the container can hold.

Initializes a new instance of the System.Net.CookieContainer class with specific properties.

Public Fields

const
DefaultCookieLengthLimitint (4096).

Represents the default maximum size, in bytes, of the System.Net.Cookie instances that the System.Net.CookieContainer can hold. This field is constant.

const
DefaultCookieLimitint (300).

Represents the default maximum number of System.Net.Cookie instances that the System.Net.CookieContainer can hold. This field is constant.

const
DefaultPerDomainCookieLimitint (20).

Represents the default maximum number of System.Net.Cookie instances that the System.Net.CookieContainer can reference per domain. This field is constant.

Public Properties

Capacityint.

Gets and sets the number of System.Net.Cookie instances that a System.Net.CookieContainer can hold.

[read-only]
Countint.

Gets the number of System.Net.Cookie instances that a System.Net.CookieContainer currently holds.

MaxCookieSizeint.

Represents the maximum allowed length of a System.Net.Cookie.

PerDomainCapacityint.

Gets and sets the number of System.Net.Cookie instances that a System.Net.CookieContainer can hold per domain.

Public Methods

Add(Cookie)

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.

Add(CookieCollection)

Adds the contents of a System.Net.CookieCollection to the System.Net.CookieContainer.

Add(Uri, Cookie)

Adds a System.Net.Cookie to the System.Net.CookieContainer for a particular URI.

Add(Uri, CookieCollection)

Adds the contents of a System.Net.CookieCollection to the System.Net.CookieContainer for a particular URI.

GetCookieHeader(Uri) : string

Gets the HTTP cookie header that contains the HTTP cookies that represent the System.Net.Cookie instances that are associated with a specific URI.

GetCookies(Uri) : CookieCollection

Gets a System.Net.CookieCollection that contains the System.Net.Cookie instances that are associated with a specific URI.

SetCookies(Uri, string)

Adds System.Net.Cookie instances for one or more cookies from an HTTP cookie header to the System.Net.CookieContainer for a specific URI.