CookieBuilder.Build 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
Build(HttpContext) |
从给定 |
Build(HttpContext, DateTimeOffset) |
从给定 |
Build(HttpContext)
- Source:
- CookieBuilder.cs
- Source:
- CookieBuilder.cs
- Source:
- CookieBuilder.cs
从给定 context
的 创建 Cookie 选项。
public:
Microsoft::AspNetCore::Http::CookieOptions ^ Build(Microsoft::AspNetCore::Http::HttpContext ^ context);
public Microsoft.AspNetCore.Http.CookieOptions Build (Microsoft.AspNetCore.Http.HttpContext context);
member this.Build : Microsoft.AspNetCore.Http.HttpContext -> Microsoft.AspNetCore.Http.CookieOptions
Public Function Build (context As HttpContext) As CookieOptions
参数
- context
- HttpContext
返回
Cookie 选项。
适用于
Build(HttpContext, DateTimeOffset)
- Source:
- CookieBuilder.cs
- Source:
- CookieBuilder.cs
- Source:
- CookieBuilder.cs
从给定 context
的 创建 Cookie 选项,其过期时间基于 expiresFrom
和 Expiration。
public:
virtual Microsoft::AspNetCore::Http::CookieOptions ^ Build(Microsoft::AspNetCore::Http::HttpContext ^ context, DateTimeOffset expiresFrom);
public virtual Microsoft.AspNetCore.Http.CookieOptions Build (Microsoft.AspNetCore.Http.HttpContext context, DateTimeOffset expiresFrom);
abstract member Build : Microsoft.AspNetCore.Http.HttpContext * DateTimeOffset -> Microsoft.AspNetCore.Http.CookieOptions
override this.Build : Microsoft.AspNetCore.Http.HttpContext * DateTimeOffset -> Microsoft.AspNetCore.Http.CookieOptions
Public Overridable Function Build (context As HttpContext, expiresFrom As DateTimeOffset) As CookieOptions
参数
- context
- HttpContext
- expiresFrom
- DateTimeOffset
用作计算 Expires基础的时间。
返回
Cookie 选项。