Retrieves cookies for the current page’s URL or specified URLs. If no URLs are provided, cookies for the current page URL are returned. If URLs are provided, only cookies for those specific URLs are returned. Example: cookies(urls: ["https://example.com", "https://another.com"])

Definition

cookies(
  urls: [String]
): [Cookie]

Arguments

urls: [String]

An optional list of URLs to retrieve cookies for. If omitted, cookies for the current page’s URL are returned. Example: ["https://www.example.com", "https://sub.example.com"]

Returns

[Cookie]

Represents a browser cookie.

Usage

This field is available on the Page object. Use it to query page information and content.