Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Net.​Cookie

Assembly: System.Net.Primitives

Inheritance: object → Cookie

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

Properties

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

Methods

public bool
Equals​(object comparand)
comparand A reference to a <see cref="T:System.Net.Cookie" /> .
Returns Returns <see langword="true" /> if the <see cref="T:System.Net.Cookie" /> is equal to <paramref name="comparand" /> . Two <see cref="T:System.Net.Cookie" /> instances are equal if their <see cref="P:System.Net.Cookie.Name" /> , <see cref="P:System.Net.Cookie.Value" /> , <see cref="P:System.Net.Cookie.Path" /> , <see cref="P:System.Net.Cookie.Domain" /> , and <see cref="P:System.Net.Cookie.Version" /> properties are equal. <see cref="P:System.Net.Cookie.Name" /> and <see cref="P:System.Net.Cookie.Domain" /> string comparisons are case-insensitive.
Overrides the <see cref="M:System.Object.Equals(System.Object)" /> method.
public int
GetHashCode​()
Returns The 32-bit signed integer hash code for this instance.
Overrides the <see cref="M:System.Object.GetHashCode" /> method.
public string
ToString​()
Returns Returns a string representation of this <see cref="T:System.Net.Cookie" /> object that is suitable for including in a HTTP Cookie: request header.
Overrides the <see cref="M:System.Object.ToString" /> method.
protected void
Finalize​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object