CookieParam 接口
用于在页面级 Cookie API 中设置 Cookie 的 Cookie 参数对象。
签名
export interface CookieParam
属性
|
属性 |
修饰符 |
类型 |
说明 |
默认值 |
|---|---|---|---|---|
|
domain |
|
string |
Cookie 域名。 | |
|
expires |
|
number |
Cookie 过期日期,未设置则为会话 Cookie | |
|
httpOnly |
|
boolean |
如果 Cookie 是 http-only,则为 true。 | |
|
name |
string |
Cookie 名称。 | ||
|
partitionKey |
|
CookiePartitionKey | string |
Cookie 分区键。在 Chrome 中,它匹配分区 Cookie 可用的顶级站点。在 Firefox 中,它匹配 PartitionKey 中的源来源。 | |
|
path |
|
string |
Cookie 路径。 | |
|
priority |
|
Cookie 优先级。仅在 Chrome 中受支持。 | ||
|
sameSite |
|
Cookie SameSite 类型。 | ||
|
secure |
|
boolean |
如果 Cookie 是 secure,则为 true。 | |
|
sourceScheme |
|
Cookie 源方案类型。仅在 Chrome 中受支持。 | ||
|
url |
|
string |
与 Cookie 的设置关联的 request-URI。此值会影响所创建 Cookie 的默认域名、路径和源方案值。 | |
|
value |
string |
Cookie 值。 |