Back to Puppeteer

CookieData interface

website/versioned_docs/version-24.40.0/api/puppeteer.cookiedata.md

19.2.22.5 KB
Original Source

CookieData interface

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

Signature

typescript
export interface CookieData

Properties

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th><th>

Default

</th></tr></thead> <tbody><tr><td>

<span id="domain">domain</span>

</td><td> </td><td>

string

</td><td>

Cookie domain.

</td><td> </td></tr> <tr><td>

<span id="expires">expires</span>

</td><td>

optional

</td><td>

number

</td><td>

Cookie expiration date, session cookie if not set

</td><td> </td></tr> <tr><td>

<span id="httponly">httpOnly</span>

</td><td>

optional

</td><td>

boolean

</td><td>

True if cookie is http-only.

</td><td> </td></tr> <tr><td>

<span id="name">name</span>

</td><td> </td><td>

string

</td><td>

Cookie name.

</td><td> </td></tr> <tr><td>

<span id="partitionkey">partitionKey</span>

</td><td>

optional

</td><td>

CookiePartitionKey | string

</td><td>

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.

</td><td> </td></tr> <tr><td>

<span id="path">path</span>

</td><td>

optional

</td><td>

string

</td><td>

Cookie path.

</td><td> </td></tr> <tr><td>

<span id="priority">priority</span>

</td><td>

optional

</td><td>

CookiePriority

</td><td>

Cookie Priority. Supported only in Chrome.

</td><td> </td></tr> <tr><td>

<span id="sameparty">sameParty</span>

</td><td>

optional, deprecated

</td><td>

boolean

</td><td>

Deprecated:

Always set to false. Supported only in Chrome.

</td><td> </td></tr> <tr><td>

<span id="samesite">sameSite</span>

</td><td>

optional

</td><td>

CookieSameSite

</td><td>

Cookie SameSite type.

</td><td> </td></tr> <tr><td>

<span id="secure">secure</span>

</td><td>

optional

</td><td>

boolean

</td><td>

True if cookie is secure.

</td><td> </td></tr> <tr><td>

<span id="sourcescheme">sourceScheme</span>

</td><td>

optional

</td><td>

CookieSourceScheme

</td><td>

Cookie source scheme type. Supported only in Chrome.

</td><td> </td></tr> <tr><td>

<span id="value">value</span>

</td><td> </td><td>

string

</td><td>

Cookie value.

</td><td> </td></tr> </tbody></table>