CookieParam 介面
用於在頁面層級 cookies API 中設定 cookie 的 Cookie 參數物件。
簽名
export interface CookieParam
屬性
屬性 | 修飾符 | 類型 | 描述 | 預設值 |
---|---|---|---|---|
domain |
| 字串 | Cookie 網域。 | |
expires |
| 數字 | Cookie 過期日,若未設定則為會期 Cookie | |
httpOnly |
| 布林值 | 若 Cookie 為 http-only 則為 True。 | |
name | 字串 | Cookie 名稱。 | ||
partitionKey |
| CookiePartitionKey | 字串 | Cookie 分區金鑰。在 Chrome 中,它與分割 cookie 可用的頂層網站相符。在 Firefox 中,它與來源網域相符 (https://w3c.github.io/webdriver-bidi/\#type-storage-PartitionKey)。 | |
path |
| 字串 | Cookie 路徑。 | |
priority |
| Cookie 優先順序。僅 Chrome 支援。 | ||
sameParty |
| 布林值 | 若 Cookie 為 SameParty 則為 True。僅 Chrome 支援。 | |
sameSite |
| Cookie SameSite 類型。 | ||
secure |
| 布林值 | 若 Cookie 為安全 Cookie 則為 True。 | |
sourceScheme |
| Cookie 來源協定類型。僅 Chrome 支援。 | ||
url |
| 字串 | 要與 Cookie 設定相關聯的 request-URI。此值可能會影響所建立 cookie 的預設網域、路徑和來源協定值。 | |
value | 字串 | Cookie 值。 |