CookieBuilder.Build 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Build(HttpContext) |
從指定的 |
Build(HttpContext, DateTimeOffset) |
根據 和 Expiration ,從指定的 |
Build(HttpContext)
從指定的 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)
根據 和 Expiration ,從指定的 context
建立 Cookie 選項,並具有到期日 expiresFrom
。
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 選項。