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 Microsoft.​Net.​Http.​Headers.​SetCookieHeaderValue
Assembly: Microsoft.Net.Http.Headers
Inheritance: object → SetCookieHeaderValue
Represents the <c>Set-Cookie</c> header. <para> See http://tools.ietf.org/html/rfc6265 for the Set-Cookie header specification. </para>
Properties
Gets or sets the cookie name.
Gets or sets the cookie value.
Expires
Gets or sets a value for the <c>Expires</c> cookie attribute.
<para>
The Expires attribute indicates the maximum lifetime of the cookie,
represented as the date and time at which the cookie expires.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc6265#section-4.1.2.1" /> .
public
System.​TimeSpan?
MaxAge
Gets or sets a value for the <c>Max-Age</c> cookie attribute.
<para>
The Max-Age attribute indicates the maximum lifetime of the cookie,
represented as the number of seconds until the cookie expires.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc6265#section-4.1.2.2" /> .
Gets or sets a value for the <c>Domain</c> cookie attribute.
<para>
The Domain attribute specifies those hosts to which the cookie will
be sent.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc6265#section-4.1.2.3" /> .
Gets or sets a value for the <c>Path</c> cookie attribute.
<para>
The path attribute specifies those hosts to which the cookie will
be sent.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc6265#section-4.1.2.4" /> .
public
bool
Secure
Gets or sets a value for the <c>Secure</c> cookie attribute.
<para>
The Secure attribute limits the scope of the cookie to "secure"
channels.
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc6265#section-4.1.2.5" /> .
public
SameSiteMode
SameSite
Gets or sets a value for the <c>SameSite</c> cookie attribute.
<para>
"SameSite" cookies offer a robust defense against CSRF attack when
deployed in strict mode, and when supported by the client.
</para>
Remarks See <see href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-05#section-8.8" /> .
public
bool
HttpOnly
Gets or sets a value for the <c>HttpOnly</c> cookie attribute.
<para>
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).
</para>
Remarks See <see href="https://tools.ietf.org/html/rfc6265#section-4.1.2.6" /> .
public
System.​Collections.​Generic.​IList<​Extensions.​Primitives.​StringSegment>
Extensions
Gets a collection of additional values to append to the cookie.
Methods
public
string
ToString​()
public
void
AppendToStringBuilder​(System.​Text.​StringBuilder builder)
Append string representation of this <see cref="T:Microsoft.Net.Http.Headers.SetCookieHeaderValue" /> to given
<paramref name="builder" /> .
builder
The <see cref="T:System.Text.StringBuilder" /> to receive the string representation of this
<see cref="T:Microsoft.Net.Http.Headers.SetCookieHeaderValue" /> .
public static
SetCookieHeaderValue
Parse​(Extensions.​Primitives.​StringSegment input)
Parses <paramref name="input" /> as a <see cref="T:Microsoft.Net.Http.Headers.SetCookieHeaderValue" /> value.
Returns The parsed values.
input
The values to parse.
public static
bool
TryParse​(Extensions.​Primitives.​StringSegment input,
SetCookieHeaderValue& parsedValue)
public static
System.​Collections.​Generic.​IList<​SetCookieHeaderValue>
ParseList​(System.​Collections.​Generic.​IList?<​string> inputs)
Parses a sequence of inputs as a sequence of <see cref="T:Microsoft.Net.Http.Headers.SetCookieHeaderValue" /> values.
Returns The parsed values.
inputs
The values to parse.
public static
System.​Collections.​Generic.​IList<​SetCookieHeaderValue>
ParseStrictList​(System.​Collections.​Generic.​IList?<​string> inputs)
Parses a sequence of inputs as a sequence of <see cref="T:Microsoft.Net.Http.Headers.SetCookieHeaderValue" /> values using string parsing rules.
Returns The parsed values.
inputs
The values to parse.
public static
bool
TryParseList​(System.​Collections.​Generic.​IList?<​string> inputs,
System.​Collections.​Generic.​IList`1&? parsedValues)
public static
bool
TryParseStrictList​(System.​Collections.​Generic.​IList?<​string> inputs,
System.​Collections.​Generic.​IList`1&? parsedValues)
public
bool
Equals​(object obj)
public
int
GetHashCode​()
protected
void
Finalize​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object