My Project
|
Provides a set of methods and properties used to manage an HTTP cookie. More...
Public Member Functions | |
Cookie (string name, string value) | |
Initializes a new instance of the Cookie class with the specified name and value. | |
Cookie (string name, string value, string path) | |
Initializes a new instance of the Cookie class with the specified name, value, and path. | |
Cookie (string name, string value, string path, string domain) | |
Initializes a new instance of the Cookie class with the specified name, value, path, and domain. | |
Properties | |
string | Comment [get, set] |
Gets the value of the Comment attribute of the cookie. | |
Uri | CommentUri [get, set] |
Gets the value of the CommentURL attribute of the cookie. | |
bool | Discard [get, set] |
Gets a value indicating whether the client discards the cookie unconditionally when the client terminates. | |
string | Domain [get, set] |
Gets or sets the value of the Domain attribute of the cookie. | |
bool | Expired [get, set] |
Gets or sets a value indicating whether the cookie has expired. | |
DateTime | Expires [get, set] |
Gets or sets the value of the Expires attribute of the cookie. | |
bool | HttpOnly [get, set] |
Gets or sets a value indicating whether non-HTTP APIs can access the cookie. | |
string | Name [get, set] |
Gets or sets the name of the cookie. | |
string | Path [get, set] |
Gets or sets the value of the Path attribute of the cookie. | |
string | Port [get, set] |
Gets the value of the Port attribute of the cookie. | |
bool | Secure [get, set] |
Gets or sets a value indicating whether the security level of the cookie is secure. | |
DateTime | TimeStamp [get] |
Gets the time when the cookie was issued. | |
Provides a set of methods and properties used to manage an HTTP cookie.
This class refers to the following specifications:
RFC 2109
RFC 2965
RFC 6265
This class cannot be inherited.
|
inline |
Initializes a new instance of the Cookie class with the specified name and value.
name | A string that specifies the name of the cookie. The name must be a token defined in RFC 2616. |
value | A string that specifies the value of the cookie. |
ArgumentNullException | name is null . |
ArgumentException | name is an empty string.
|
|
inline |
Initializes a new instance of the Cookie class with the specified name, value, and path.
name | A string that specifies the name of the cookie. The name must be a token defined in RFC 2616. |
value | A string that specifies the value of the cookie. |
path | A string that specifies the value of the Path attribute of the cookie. |
ArgumentNullException | name is null . |
ArgumentException | name is an empty string.
|
|
inline |
Initializes a new instance of the Cookie class with the specified name, value, path, and domain.
name | A string that specifies the name of the cookie. The name must be a token defined in RFC 2616. |
value | A string that specifies the value of the cookie. |
path | A string that specifies the value of the Path attribute of the cookie. |
domain | A string that specifies the value of the Domain attribute of the cookie. |
ArgumentNullException | name is null . |
ArgumentException | name is an empty string.
|
|
getset |
Gets the value of the Comment attribute of the cookie.
A string that represents the comment to document intended use of the cookie.
null
if not present.
The default value is null
.
|
getset |
Gets the value of the CommentURL attribute of the cookie.
A Uri that represents the URI that provides the comment to document intended use of the cookie.
null
if not present.
The default value is null
.
|
getset |
Gets a value indicating whether the client discards the cookie unconditionally when the client terminates.
true
if the client discards the cookie unconditionally when the client terminates; otherwise, false
.
The default value is false
.
|
getset |
Gets or sets the value of the Domain attribute of the cookie.
A string that represents the domain name that the cookie is valid for.
An empty string if this attribute is not needed.
|
getset |
Gets or sets a value indicating whether the cookie has expired.
true
if the cookie has expired; otherwise, false
.
The default value is false
.
|
getset |
Gets or sets the value of the Expires attribute of the cookie.
A DateTime that represents the date and time that the cookie expires on.
DateTime.MinValue if this attribute is not needed.
The default value is DateTime.MinValue.
|
getset |
Gets or sets a value indicating whether non-HTTP APIs can access the cookie.
true
if non-HTTP APIs cannot access the cookie; otherwise, false
.
The default value is false
.
|
getset |
Gets or sets the name of the cookie.
A string that represents the name of the cookie.
The name must be a token defined in RFC 2616
.
ArgumentNullException | The value specified for a set operation is null . |
ArgumentException | The value specified for a set operation is an empty string.
|
|
getset |
Gets or sets the value of the Path attribute of the cookie.
A string that represents the subset of URI on the origin server that the cookie applies to.
|
getset |
Gets the value of the Port attribute of the cookie.
A string that represents the list of TCP ports that the cookie applies to.
null
if not present.
The default value is null
.
|
getset |
Gets or sets a value indicating whether the security level of the cookie is secure.
When this property is true
, the cookie may be included in the request only if the request is transmitted over HTTPS.
true
if the security level of the cookie is secure; otherwise, false
.
The default value is false
.
|
get |
Gets the time when the cookie was issued.
A DateTime that represents the time when the cookie was issued.