Skip to main content
Version: 23.11.1

Page.setCookie() method

Warning: This API is now obsolete.

Page-level cookie API is deprecated. Use Browser.setCookie() or BrowserContext.setCookie() instead.

Signature

class Page {
abstract setCookie(...cookies: CookieParam[]): Promise<void>;
}

Parameters

Parameter

Type

Description

cookies

CookieParam[]

Returns:

Promise<void>

Example

await page.setCookie(cookieObject1, cookieObject2);