mscorlib(4.0.0.0) API with additions
System.Net.Cookie Class Reference

Provides a set of properties and methods that are used to manage cookies. This class cannot be inherited. More...

Public Member Functions

 Cookie ()
 Initializes a new instance of the T:System.Net.Cookie class. More...
 
 Cookie (string name, string value)
 Initializes a new instance of the T:System.Net.Cookie class with a specified P:System.Net.Cookie.Name and P:System.Net.Cookie.Value. More...
 
 Cookie (string name, string value, string path)
 Initializes a new instance of the T:System.Net.Cookie class with a specified P:System.Net.Cookie.Name, P:System.Net.Cookie.Value, and P:System.Net.Cookie.Path. More...
 
 Cookie (string name, string value, string path, string domain)
 Initializes a new instance of the T:System.Net.Cookie class with a specified P:System.Net.Cookie.Name, P:System.Net.Cookie.Value, P:System.Net.Cookie.Path, and P:System.Net.Cookie.Domain. More...
 
override bool Equals (object comparand)
 Overrides the M:System.Object.Equals(System.Object) method. More...
 
override int GetHashCode ()
 Overrides the M:System.Object.GetHashCode method. More...
 
override string ToString ()
 Overrides the M:System.Object.ToString method. More...
 

Properties

string Comment [get, set]
 Gets or sets a comment that the server can add to a T:System.Net.Cookie. More...
 
Uri CommentUri [get, set]
 Gets or sets a URI comment that the server can provide with a T:System.Net.Cookie. More...
 
bool HttpOnly [get, set]
 Determines whether a page script or other active content can access this cookie. More...
 
bool Discard [get, set]
 Gets or sets the discard flag set by the server. More...
 
string? Domain [get, set]
 Gets or sets the URI for which the T:System.Net.Cookie is valid. More...
 
bool Expired [get, set]
 Gets or sets the current state of the T:System.Net.Cookie. More...
 
DateTime Expires [get, set]
 Gets or sets the expiration date and time for the T:System.Net.Cookie as a T:System.DateTime. More...
 
string? Name [get, set]
 Gets or sets the name for the T:System.Net.Cookie. More...
 
string? Path [get, set]
 Gets or sets the URIs to which the T:System.Net.Cookie applies. More...
 
string Port [get, set]
 Gets or sets a list of TCP ports that the T:System.Net.Cookie applies to. More...
 
bool Secure [get, set]
 Gets or sets the security level of a T:System.Net.Cookie. More...
 
DateTime TimeStamp [get]
 Gets the time when the cookie was issued as a T:System.DateTime. More...
 
string? Value [get, set]
 Gets or sets the P:System.Net.Cookie.Value for the T:System.Net.Cookie. More...
 
int Version [get, set]
 Gets or sets the version of HTTP state maintenance to which the cookie conforms. More...
 

Detailed Description

Provides a set of properties and methods that are used to manage cookies. This class cannot be inherited.

Definition at line 11 of file Cookie.cs.

Constructor & Destructor Documentation

◆ Cookie() [1/4]

System.Net.Cookie.Cookie ( )

Initializes a new instance of the T:System.Net.Cookie class.

Definition at line 498 of file Cookie.cs.

◆ Cookie() [2/4]

System.Net.Cookie.Cookie ( string  name,
string  value 
)

Initializes a new instance of the T:System.Net.Cookie class with a specified P:System.Net.Cookie.Name and P:System.Net.Cookie.Value.

Parameters
nameThe name of a T:System.Net.Cookie. The following characters must not be used inside name : equal sign, semicolon, comma, newline (
), return (\r), tab (\t), and space character. The dollar sign character ("$") cannot be the first character.
valueThe value of a T:System.Net.Cookie. The following characters must not be used inside value : semicolon, comma.
Exceptions
T:System.Net.CookieExceptionThe name parameter is null. -or- The name parameter is of zero length. -or- The name parameter contains an invalid character.-or- The value parameter is null .-or - The value parameter contains a string not enclosed in quotes that contains an invalid character.

Definition at line 507 of file Cookie.cs.

◆ Cookie() [3/4]

System.Net.Cookie.Cookie ( string  name,
string  value,
string  path 
)

Initializes a new instance of the T:System.Net.Cookie class with a specified P:System.Net.Cookie.Name, P:System.Net.Cookie.Value, and P:System.Net.Cookie.Path.

Parameters
nameThe name of a T:System.Net.Cookie. The following characters must not be used inside name : equal sign, semicolon, comma, newline (
), return (\r), tab (\t), and space character. The dollar sign character ("$") cannot be the first character.
valueThe value of a T:System.Net.Cookie. The following characters must not be used inside value : semicolon, comma.
pathThe subset of URIs on the origin server to which this T:System.Net.Cookie applies. The default value is "/".
Exceptions
T:System.Net.CookieExceptionThe name parameter is null. -or- The name parameter is of zero length. -or- The name parameter contains an invalid character.-or- The value parameter is null .-or - The value parameter contains a string not enclosed in quotes that contains an invalid character.

Definition at line 519 of file Cookie.cs.

◆ Cookie() [4/4]

System.Net.Cookie.Cookie ( string  name,
string  value,
string  path,
string  domain 
)

Initializes a new instance of the T:System.Net.Cookie class with a specified P:System.Net.Cookie.Name, P:System.Net.Cookie.Value, P:System.Net.Cookie.Path, and P:System.Net.Cookie.Domain.

Parameters
nameThe name of a T:System.Net.Cookie. The following characters must not be used inside name : equal sign, semicolon, comma, newline (
), return (\r), tab (\t), and space character. The dollar sign character ("$") cannot be the first character.
valueThe value of a T:System.Net.Cookie object. The following characters must not be used inside value : semicolon, comma.
pathThe subset of URIs on the origin server to which this T:System.Net.Cookie applies. The default value is "/".
domainThe optional internet domain for which this T:System.Net.Cookie is valid. The default value is the host this T:System.Net.Cookie has been received from.
Exceptions
T:System.Net.CookieExceptionThe name parameter is null. -or- The name parameter is of zero length. -or- The name parameter contains an invalid character.-or- The value parameter is null .-or - The value parameter contains a string not enclosed in quotes that contains an invalid character.

Definition at line 532 of file Cookie.cs.

Member Function Documentation

◆ Equals()

override bool System.Net.Cookie.Equals ( object  comparand)

Overrides the M:System.Object.Equals(System.Object) method.

Parameters
comparandA reference to a T:System.Net.Cookie.
Returns
Returns true if the T:System.Net.Cookie is equal to comparand . Two T:System.Net.Cookie instances are equal if their P:System.Net.Cookie.Name, P:System.Net.Cookie.Value, P:System.Net.Cookie.Path, P:System.Net.Cookie.Domain, and P:System.Net.Cookie.Version properties are equal. P:System.Net.Cookie.Name and P:System.Net.Cookie.Domain string comparisons are case-insensitive.

Definition at line 818 of file Cookie.cs.

◆ GetHashCode()

override int System.Net.Cookie.GetHashCode ( )

Overrides the M:System.Object.GetHashCode method.

Returns
The 32-bit signed integer hash code for this instance.

Definition at line 835 of file Cookie.cs.

◆ ToString()

override string System.Net.Cookie.ToString ( )

Overrides the M:System.Object.ToString method.

Returns
Returns a string representation of this T:System.Net.Cookie object that is suitable for including in a HTTP Cookie: request header.

Definition at line 843 of file Cookie.cs.

Property Documentation

◆ Comment

string System.Net.Cookie.Comment
getset

Gets or sets a comment that the server can add to a T:System.Net.Cookie.

Returns
An optional comment to document intended usage for this T:System.Net.Cookie.

Definition at line 118 of file Cookie.cs.

◆ CommentUri

Uri System.Net.Cookie.CommentUri
getset

Gets or sets a URI comment that the server can provide with a T:System.Net.Cookie.

Returns
An optional comment that represents the intended usage of the URI reference for this T:System.Net.Cookie. The value must conform to URI format.

Definition at line 139 of file Cookie.cs.

◆ Discard

bool System.Net.Cookie.Discard
getset

Gets or sets the discard flag set by the server.

Returns
true if the client is to discard the T:System.Net.Cookie at the end of the current session; otherwise, false. The default is false.

Definition at line 174 of file Cookie.cs.

◆ Domain

string? System.Net.Cookie.Domain
getset

Gets or sets the URI for which the T:System.Net.Cookie is valid.

Returns
The URI for which the T:System.Net.Cookie is valid.

Definition at line 191 of file Cookie.cs.

◆ Expired

bool System.Net.Cookie.Expired
getset

Gets or sets the current state of the T:System.Net.Cookie.

Returns
true if the T:System.Net.Cookie has expired; otherwise, false. The default is false.

Definition at line 235 of file Cookie.cs.

◆ Expires

DateTime System.Net.Cookie.Expires
getset

Gets or sets the expiration date and time for the T:System.Net.Cookie as a T:System.DateTime.

Returns
The expiration date and time for the T:System.Net.Cookie as a T:System.DateTime instance.

Definition at line 259 of file Cookie.cs.

◆ HttpOnly

bool System.Net.Cookie.HttpOnly
getset

Determines whether a page script or other active content can access this cookie.

Returns
Boolean value that determines whether a page script or other active content can access this cookie.

Definition at line 156 of file Cookie.cs.

◆ Name

string? System.Net.Cookie.Name
getset

Gets or sets the name for the T:System.Net.Cookie.

Returns
The name for the T:System.Net.Cookie.
Exceptions
T:System.Net.CookieExceptionThe value specified for a set operation is null or the empty string- or -The value specified for a set operation contained an illegal character. The following characters must not be used inside the P:System.Net.Cookie.Name property: equal sign, semicolon, comma, newline (
), return (\r), tab (\t), and space character. The dollar sign character ("$") cannot be the first character.

Definition at line 277 of file Cookie.cs.

◆ Path

string? System.Net.Cookie.Path
getset

Gets or sets the URIs to which the T:System.Net.Cookie applies.

Returns
The URIs to which the T:System.Net.Cookie applies.

Definition at line 297 of file Cookie.cs.

◆ Port

string System.Net.Cookie.Port
getset

Gets or sets a list of TCP ports that the T:System.Net.Cookie applies to.

Returns
The list of TCP ports that the T:System.Net.Cookie applies to.
Exceptions
T:System.Net.CookieExceptionThe value specified for a set operation could not be parsed or is not enclosed in double quotes.

Definition at line 330 of file Cookie.cs.

◆ Secure

bool System.Net.Cookie.Secure
getset

Gets or sets the security level of a T:System.Net.Cookie.

Returns
true if the client is only to return the cookie in subsequent requests if those requests use Secure Hypertext Transfer Protocol (HTTPS); otherwise, false. The default is false.

Definition at line 392 of file Cookie.cs.

◆ TimeStamp

DateTime System.Net.Cookie.TimeStamp
get

Gets the time when the cookie was issued as a T:System.DateTime.

Returns
The time when the cookie was issued as a T:System.DateTime.

Definition at line 409 of file Cookie.cs.

◆ Value

string? System.Net.Cookie.Value
getset

Gets or sets the P:System.Net.Cookie.Value for the T:System.Net.Cookie.

Returns
The P:System.Net.Cookie.Value for the T:System.Net.Cookie.

Definition at line 421 of file Cookie.cs.

◆ Version

int System.Net.Cookie.Version
getset

Gets or sets the version of HTTP state maintenance to which the cookie conforms.

Returns
The version of HTTP state maintenance to which the cookie conforms.
Exceptions
T:System.ArgumentOutOfRangeExceptionThe value specified for a version is not allowed.

Definition at line 463 of file Cookie.cs.


The documentation for this class was generated from the following file: