Skip to main content
Version: 24.38.0

CookieData 接口

🌐 CookieData interface

用于在浏览器级 cookies API 中设置 cookies 的 Cookie 参数对象。

🌐 Cookie parameter object used to set cookies in the browser-level cookies API.

语法

🌐 Signature

export interface CookieData

属性

🌐 Properties

属性

🌐 Property

修饰符

🌐 Modifiers

类型

🌐 Type

描述

🌐 Description

默认

🌐 Default

domain

string

Cookie 域。

🌐 Cookie domain.

expires

optional

number

Cookie 过期日期,如果未设置会话 cookie

🌐 Cookie expiration date, session cookie if not set

httpOnly

optional

boolean

如果 cookie 仅限 http,则为 True。

🌐 True if cookie is http-only.

name

string

Cookie 名称。

🌐 Cookie name.

partitionKey

optional

[CookiePartitionKey](./puppeteer.cookiepartitionkey.md) |弦

Cookie 分区键。在 Chrome 中,它与分区 cookie 可用的顶层站点匹配。在 Firefox 中,它与 PartitionKey 中的源来源匹配。

🌐 Cookie partition key. In Chrome, it matches the top-level site the partitioned cookie is available in. In Firefox, it matches the source origin in the PartitionKey.

path

optional

string

Cookie 路径。

🌐 Cookie path.

priority

optional

CookiePriority

Cookie 优先级。仅在 Chrome 中支持。

🌐 Cookie Priority. Supported only in Chrome.

sameParty

optional, deprecated

boolean

已弃用:

始终设置为 false。仅在 Chrome 中支持。

🌐 Always set to false. Supported only in Chrome.

sameSite

optional

CookieSameSite

Cookie SameSite 类型。

🌐 Cookie SameSite type.

secure

optional

boolean

如果 cookie 是安全的,则为 True。

🌐 True if cookie is secure.

sourceScheme

optional

CookieSourceScheme

Cookie 源方案类型。仅在 Chrome 中支持。

🌐 Cookie source scheme type. Supported only in Chrome.

value

string

Cookie 值。

🌐 Cookie value.