Provides a container for a collection of T:System.Net.CookieCollection objects.
More...
|
| CookieContainer () |
| Initializes a new instance of the T:System.Net.CookieContainer class. More...
|
|
| CookieContainer (int capacity) |
| Initializes a new instance of the T:System.Net.CookieContainer class with a specified value for the number of T:System.Net.Cookie instances that the container can hold. More...
|
|
| CookieContainer (int capacity, int perDomainCapacity, int maxCookieSize) |
| Initializes a new instance of the T:System.Net.CookieContainer class with specific properties. More...
|
|
void | Add (Cookie cookie) |
| Adds a T:System.Net.Cookie to a T:System.Net.CookieContainer. This method uses the domain from the T:System.Net.Cookie to determine which domain collection to associate the T:System.Net.Cookie with. More...
|
|
void | Add (CookieCollection cookies) |
| Adds the contents of a T:System.Net.CookieCollection to the T:System.Net.CookieContainer. More...
|
|
void | Add (Uri uri, Cookie cookie) |
| Adds a T:System.Net.Cookie to the T:System.Net.CookieContainer for a particular URI. More...
|
|
void | Add (Uri uri, CookieCollection cookies) |
| Adds the contents of a T:System.Net.CookieCollection to the T:System.Net.CookieContainer for a particular URI. More...
|
|
CookieCollection | GetCookies (Uri uri) |
| Gets a T:System.Net.CookieCollection that contains the T:System.Net.Cookie instances that are associated with a specific URI. More...
|
|
string | GetCookieHeader (Uri uri) |
| Gets the HTTP cookie header that contains the HTTP cookies that represent the T:System.Net.Cookie instances that are associated with a specific URI. More...
|
|
void | SetCookies (Uri uri, string cookieHeader) |
| Adds T:System.Net.Cookie instances for one or more cookies from an HTTP cookie header to the T:System.Net.CookieContainer for a specific URI. More...
|
|
|
const int | DefaultCookieLimit = 300 |
| Represents the default maximum number of T:System.Net.Cookie instances that the T:System.Net.CookieContainer can hold. This field is constant. More...
|
|
const int | DefaultPerDomainCookieLimit = 20 |
| Represents the default maximum number of T:System.Net.Cookie instances that the T:System.Net.CookieContainer can reference per domain. This field is constant. More...
|
|
const int | DefaultCookieLengthLimit = 4096 |
| Represents the default maximum size, in bytes, of the T:System.Net.Cookie instances that the T:System.Net.CookieContainer can hold. This field is constant. More...
|
|
|
int | Capacity [get, set] |
| Gets and sets the number of T:System.Net.Cookie instances that a T:System.Net.CookieContainer can hold. More...
|
|
int | Count [get] |
| Gets the number of T:System.Net.Cookie instances that a T:System.Net.CookieContainer currently holds. More...
|
|
int | MaxCookieSize [get, set] |
| Represents the maximum allowed length of a T:System.Net.Cookie. More...
|
|
int | PerDomainCapacity [get, set] |
| Gets and sets the number of T:System.Net.Cookie instances that a T:System.Net.CookieContainer can hold per domain. More...
|
|
Provides a container for a collection of T:System.Net.CookieCollection objects.
Definition at line 13 of file CookieContainer.cs.
◆ CookieContainer() [1/3]
System.Net.CookieContainer.CookieContainer |
( |
| ) |
|
Initializes a new instance of the T:System.Net.CookieContainer class.
Definition at line 139 of file CookieContainer.cs.
◆ CookieContainer() [2/3]
System.Net.CookieContainer.CookieContainer |
( |
int |
capacity | ) |
|
Initializes a new instance of the T:System.Net.CookieContainer class with a specified value for the number of T:System.Net.Cookie instances that the container can hold.
- Parameters
-
capacity | The number of T:System.Net.Cookie instances that the T:System.Net.CookieContainer can hold. |
- Exceptions
-
T:System.ArgumentException | capacity is less than or equal to zero. |
Definition at line 152 of file CookieContainer.cs.
◆ CookieContainer() [3/3]
System.Net.CookieContainer.CookieContainer |
( |
int |
capacity, |
|
|
int |
perDomainCapacity, |
|
|
int |
maxCookieSize |
|
) |
| |
Initializes a new instance of the T:System.Net.CookieContainer class with specific properties.
- Parameters
-
capacity | The number of T:System.Net.Cookie instances that the T:System.Net.CookieContainer can hold. |
perDomainCapacity | The number of T:System.Net.Cookie instances per domain. |
maxCookieSize | The maximum size in bytes for any single T:System.Net.Cookie in a T:System.Net.CookieContainer. |
- Exceptions
-
T:System.ArgumentOutOfRangeException | perDomainCapacity is not equal to F:System.Int32.MaxValue. and (perDomainCapacity is less than or equal to zero or perDomainCapacity is greater than capacity) . |
T:System.ArgumentException | maxCookieSize is less than or equal to zero. |
Definition at line 171 of file CookieContainer.cs.
◆ Add() [1/4]
void System.Net.CookieContainer.Add |
( |
Cookie |
cookie | ) |
|
Adds a T:System.Net.Cookie to a T:System.Net.CookieContainer. This method uses the domain from the T:System.Net.Cookie to determine which domain collection to associate the T:System.Net.Cookie with.
- Parameters
-
cookie | The T:System.Net.Cookie to be added to the T:System.Net.CookieContainer. |
- Exceptions
-
T:System.ArgumentNullException | cookie is null . |
T:System.ArgumentException | The domain for cookie is null or the empty string (""). |
T:System.Net.CookieException | cookie is larger than maxCookieSize . -or- the domain for cookie is not a valid URI. |
Definition at line 193 of file CookieContainer.cs.
◆ Add() [2/4]
Adds the contents of a T:System.Net.CookieCollection to the T:System.Net.CookieContainer.
- Parameters
-
cookies | The T:System.Net.CookieCollection to be added to the T:System.Net.CookieContainer. |
- Exceptions
-
T:System.ArgumentNullException | cookies is null . |
Definition at line 447 of file CookieContainer.cs.
◆ Add() [3/4]
void System.Net.CookieContainer.Add |
( |
Uri |
uri, |
|
|
Cookie |
cookie |
|
) |
| |
Adds a T:System.Net.Cookie to the T:System.Net.CookieContainer for a particular URI.
- Parameters
-
uri | The URI of the T:System.Net.Cookie to be added to the T:System.Net.CookieContainer. |
cookie | The T:System.Net.Cookie to be added to the T:System.Net.CookieContainer. |
- Exceptions
-
T:System.ArgumentNullException | uri is null or cookie is null . |
T:System.Net.CookieException | cookie is larger than maxCookieSize . -or- The domain for cookie is not a valid URI. |
Definition at line 519 of file CookieContainer.cs.
◆ Add() [4/4]
Adds the contents of a T:System.Net.CookieCollection to the T:System.Net.CookieContainer for a particular URI.
- Parameters
-
uri | The URI of the T:System.Net.CookieCollection to be added to the T:System.Net.CookieContainer. |
cookies | The T:System.Net.CookieCollection to be added to the T:System.Net.CookieContainer. |
- Exceptions
-
T:System.ArgumentNullException | cookies is null . |
T:System.ArgumentException | The domain for one of the cookies in cookies is null . |
T:System.Net.CookieException | One of the cookies in cookies contains an invalid domain. |
Definition at line 542 of file CookieContainer.cs.
◆ GetCookieHeader()
string System.Net.CookieContainer.GetCookieHeader |
( |
Uri |
uri | ) |
|
Gets the HTTP cookie header that contains the HTTP cookies that represent the T:System.Net.Cookie instances that are associated with a specific URI.
- Parameters
-
uri | The URI of the T:System.Net.Cookie instances desired. |
- Returns
- An HTTP cookie header, with strings representing T:System.Net.Cookie instances delimited by semicolons.
- Exceptions
-
T:System.ArgumentNullException | uri is null . |
Definition at line 786 of file CookieContainer.cs.
◆ GetCookies()
Gets a T:System.Net.CookieCollection that contains the T:System.Net.Cookie instances that are associated with a specific URI.
- Parameters
-
uri | The URI of the T:System.Net.Cookie instances desired. |
- Returns
- A T:System.Net.CookieCollection that contains the T:System.Net.Cookie instances that are associated with a specific URI.
- Exceptions
-
T:System.ArgumentNullException | uri is null . |
Definition at line 627 of file CookieContainer.cs.
◆ SetCookies()
void System.Net.CookieContainer.SetCookies |
( |
Uri |
uri, |
|
|
string |
cookieHeader |
|
) |
| |
Adds T:System.Net.Cookie instances for one or more cookies from an HTTP cookie header to the T:System.Net.CookieContainer for a specific URI.
- Parameters
-
uri | The URI of the T:System.Net.CookieCollection. |
cookieHeader | The contents of an HTTP set-cookie header as returned by a HTTP server, with T:System.Net.Cookie instances delimited by commas. |
- Exceptions
-
T:System.ArgumentNullException | uri is null . |
T:System.ArgumentNullException | cookieHeader is null . |
T:System.Net.CookieException | One of the cookies is invalid. -or- An error occurred while adding one of the cookies to the container. |
Definition at line 819 of file CookieContainer.cs.
◆ DefaultCookieLengthLimit
const int System.Net.CookieContainer.DefaultCookieLengthLimit = 4096 |
Represents the default maximum size, in bytes, of the T:System.Net.Cookie instances that the T:System.Net.CookieContainer can hold. This field is constant.
Definition at line 25 of file CookieContainer.cs.
◆ DefaultCookieLimit
const int System.Net.CookieContainer.DefaultCookieLimit = 300 |
Represents the default maximum number of T:System.Net.Cookie instances that the T:System.Net.CookieContainer can hold. This field is constant.
Definition at line 17 of file CookieContainer.cs.
◆ DefaultPerDomainCookieLimit
const int System.Net.CookieContainer.DefaultPerDomainCookieLimit = 20 |
Represents the default maximum number of T:System.Net.Cookie instances that the T:System.Net.CookieContainer can reference per domain. This field is constant.
Definition at line 21 of file CookieContainer.cs.
◆ Capacity
int System.Net.CookieContainer.Capacity |
|
getset |
Gets and sets the number of T:System.Net.Cookie instances that a T:System.Net.CookieContainer can hold.
- Returns
- The number of T:System.Net.Cookie instances that a T:System.Net.CookieContainer can hold. This is a hard limit and cannot be exceeded by adding a T:System.Net.Cookie.
- Exceptions
-
T:System.ArgumentOutOfRangeException | Capacity is less than or equal to zero or (value is less than P:System.Net.CookieContainer.PerDomainCapacity and P:System.Net.CookieContainer.PerDomainCapacity is not equal to F:System.Int32.MaxValue). |
Definition at line 51 of file CookieContainer.cs.
◆ Count
int System.Net.CookieContainer.Count |
|
get |
Gets the number of T:System.Net.Cookie instances that a T:System.Net.CookieContainer currently holds.
- Returns
- The number of T:System.Net.Cookie instances that a T:System.Net.CookieContainer currently holds. This is the total of T:System.Net.Cookie instances in all domains.
Definition at line 77 of file CookieContainer.cs.
◆ MaxCookieSize
int System.Net.CookieContainer.MaxCookieSize |
|
getset |
Represents the maximum allowed length of a T:System.Net.Cookie.
- Returns
- The maximum allowed length, in bytes, of a T:System.Net.Cookie.
- Exceptions
-
T:System.ArgumentOutOfRangeException | MaxCookieSize is less than or equal to zero. |
Definition at line 91 of file CookieContainer.cs.
◆ PerDomainCapacity
int System.Net.CookieContainer.PerDomainCapacity |
|
getset |
Gets and sets the number of T:System.Net.Cookie instances that a T:System.Net.CookieContainer can hold per domain.
- Returns
- The number of T:System.Net.Cookie instances that are allowed per domain.
- Exceptions
-
T:System.ArgumentOutOfRangeException | PerDomainCapacity is less than or equal to zero. -or- (PerDomainCapacity is greater than the maximum allowable number of cookies instances, 300, and is not equal to F:System.Int32.MaxValue). |
Definition at line 115 of file CookieContainer.cs.
The documentation for this class was generated from the following file: