语言

SetCookieHeaderValue 类

定义

表示 Set-Cookie 标头。

有关 Set-Cookie 标头规范,请参阅 http://tools.ietf.org/html/rfc6265 。

public ref class SetCookieHeaderValue
public class SetCookieHeaderValue
type SetCookieHeaderValue = class
Public Class SetCookieHeaderValue
继承
SetCookieHeaderValue

构造函数

名称 说明
SetCookieHeaderValue(String, String)

表示 Set-Cookie 标头。

有关 Set-Cookie 标头规范,请参阅 http://tools.ietf.org/html/rfc6265 。

SetCookieHeaderValue(String)

表示 Set-Cookie 标头。

有关 Set-Cookie 标头规范,请参阅 http://tools.ietf.org/html/rfc6265 。

SetCookieHeaderValue(StringSegment, StringSegment)

初始化 SetCookieHeaderValue 的新实例。

SetCookieHeaderValue(StringSegment)

初始化 SetCookieHeaderValue 的新实例。

属性

名称 说明
Domain

获取或设置 Cookie 属性的值 Domain 。

域属性指定 Cookie 将发送到的主机。

Expires

获取或设置 Cookie 属性的值 Expires 。

Expires 属性指示 Cookie 的最长生存期,表示为 Cookie 过期的日期和时间。

Extensions

获取要追加到 Cookie 的其他值的集合。

HttpOnly

获取或设置 Cookie 属性的值 HttpOnly 。

HttpOnly 指示用户代理在通过“非 HTTP”API ((例如 Web 浏览器 API)向脚本) 公开 Cookie 时省略 Cookie。

MaxAge

获取或设置 Cookie 属性的值 Max-Age 。

Max-Age 属性指示 Cookie 的最长生存期,表示为 Cookie 过期之前的秒数。

Name

获取或设置 Cookie 名称。

Path

获取或设置 Cookie 属性的值 Path 。

path 属性指定要将 Cookie 发送到的那些主机。

SameSite

获取或设置 Cookie 属性的值 SameSite 。

在严格模式下部署时以及客户端支持时,“SameSite”Cookie 可针对 CSRF 攻击提供强大的防御。

Secure

获取或设置 Cookie 属性的值 Secure 。

Secure 属性将 Cookie 的范围限制为“安全”通道。

Value

获取或设置 Cookie 值。

方法

名称 说明
AppendToStringBuilder(StringBuilder)

将此 SetCookieHeaderValue 的字符串表示形式追加到给定 builder的 。

Equals(Object)

表示 Set-Cookie 标头。

有关 Set-Cookie 标头规范,请参阅 http://tools.ietf.org/html/rfc6265 。

GetHashCode()

表示 Set-Cookie 标头。

有关 Set-Cookie 标头规范,请参阅 http://tools.ietf.org/html/rfc6265 。

Parse(String)

表示 Set-Cookie 标头。

有关 Set-Cookie 标头规范,请参阅 http://tools.ietf.org/html/rfc6265 。

Parse(StringSegment)

分析 input 为 SetCookieHeaderValue 值。

ParseList(IList<String>)

将输入序列分析为值序列 SetCookieHeaderValue 。

ParseStrictList(IList<String>)

使用字符串分析规则将输入序列分析为值序列 SetCookieHeaderValue 。

ToString()

表示 Set-Cookie 标头。

有关 Set-Cookie 标头规范,请参阅 http://tools.ietf.org/html/rfc6265 。

TryParse(String, SetCookieHeaderValue)

表示 Set-Cookie 标头。

有关 Set-Cookie 标头规范,请参阅 http://tools.ietf.org/html/rfc6265 。

TryParse(StringSegment, SetCookieHeaderValue)

尝试将指定的 input 解析为 SetCookieHeaderValue。

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

尝试将值序列分析为 的 SetCookieHeaderValue序列。

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

尝试使用字符串分析规则将值序列分析为 一个 SetCookieHeaderValue 序列。

适用于