SetCookieHeaderValue Class

Definition

Represents the Set-Cookie header.

See http://tools.ietf.org/html/rfc6265 for the Set-Cookie header specification.

public ref class SetCookieHeaderValue
public class SetCookieHeaderValue
type SetCookieHeaderValue = class
Public Class SetCookieHeaderValue
Inheritance
SetCookieHeaderValue

Constructors

SetCookieHeaderValue(String)
SetCookieHeaderValue(String, String)
SetCookieHeaderValue(StringSegment)

Initializes a new instance of SetCookieHeaderValue.

SetCookieHeaderValue(StringSegment, StringSegment)

Initializes a new instance of SetCookieHeaderValue.

Properties

Domain

Gets or sets a value for the Domain cookie attribute.

The Domain attribute specifies those hosts to which the cookie will be sent.

Expires

Gets or sets a value for the Expires cookie attribute.

The Expires attribute indicates the maximum lifetime of the cookie, represented as the date and time at which the cookie expires.

Extensions

Gets a collection of additional values to append to the cookie.

HttpOnly

Gets or sets a value for the HttpOnly cookie attribute.

HttpOnly instructs the user agent to omit the cookie when providing access to cookies via "non-HTTP" APIs (such as a web browser API that exposes cookies to scripts).

MaxAge

Gets or sets a value for the Max-Age cookie attribute.

The Max-Age attribute indicates the maximum lifetime of the cookie, represented as the number of seconds until the cookie expires.

Name

Gets or sets the cookie name.

Path

Gets or sets a value for the Path cookie attribute.

The path attribute specifies those hosts to which the cookie will be sent.

SameSite

Gets or sets a value for the SameSite cookie attribute.

"SameSite" cookies offer a robust defense against CSRF attack when deployed in strict mode, and when supported by the client.

Secure

Gets or sets a value for the Secure cookie attribute.

The Secure attribute limits the scope of the cookie to "secure" channels.

Value

Gets or sets the cookie value.

Methods

AppendToStringBuilder(StringBuilder)

Append string representation of this SetCookieHeaderValue to given builder.

Equals(Object)

Determines whether the specified object is equal to the current object.

GetHashCode()

Serves as the default hash function.

Parse(String)
Parse(StringSegment)

Parses input as a SetCookieHeaderValue value.

ParseList(IList<String>)

Parses a sequence of inputs as a sequence of SetCookieHeaderValue values.

ParseStrictList(IList<String>)

Parses a sequence of inputs as a sequence of SetCookieHeaderValue values using string parsing rules.

ToString()

Returns a string that represents the current object.

TryParse(String, SetCookieHeaderValue)
TryParse(StringSegment, SetCookieHeaderValue)

Attempts to parse the specified input as a SetCookieHeaderValue.

TryParseList(IList<String>, IList<SetCookieHeaderValue>)

Attempts to parse the sequence of values as a sequence of SetCookieHeaderValue.

TryParseStrictList(IList<String>, IList<SetCookieHeaderValue>)

Attempts to parse the sequence of values as a sequence of SetCookieHeaderValue using string parsing rules.

Applies to