Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallIn Puppeteer, a cookie partition key identifies the top-level-site context in which a partitioned cookie is available. In Chrome, Puppeteer calls the key’s main field sourceOrigin; it maps to the Chrome DevTools Protocol’s topLevelSite. The key is context, not another name for the cookie’s domain.
What a cookie partition key means
Chrome’s CHIPS model gives an opted-in third-party cookie a separate context for each top-level site. The cookie is double-keyed: by the setting site’s host key and by the partition key, which represents the top-level site associated with the request that set the cookie. As Chrome explains, “A partitioned third-party cookie is tied to the top-level site where it’s initially set and cannot be accessed from elsewhere.” Chrome’s CHIPS documentation describes the model and its intended isolation.
For example, an embedded service at widget.example can have one partitioned cookie when used on shop.example and a different one when used on news.example. The cookie is not thereby shared across unrelated top-level sites. This makes partitioned state useful for an embedded service that needs separate state per site, rather than for carrying one third-party cookie everywhere.
How Puppeteer represents the key
Puppeteer’s CookiePartitionKey reference (labelled Version 25.12.0) describes an object with these fields:
#1 Best Overall
sourceOrigin: the top-level-site value. The reference says this is the site of the top-level URL the browser was visiting at the start of the request to the endpoint that set the cookie. In Chrome, it maps to CDP’stopLevelSite.hasCrossSiteAncestor: an optional boolean indicating whether the cookie has ancestors that are cross-site to that top-level site. Puppeteer documents this field as Chrome-only.
Although the name sourceOrigin sounds like the origin of the embedded cookie-setting service, in this Puppeteer interface it describes the top-level-site context. Chromium’s extensions schema uses the name topLevelSite for the corresponding concept: Chromium cookies API schema.
Where to pass partitionKey in Puppeteer
Puppeteer documents an optional partitionKey in both browser-level CookieData and page-level CookieParam. The browser-level reference is labelled Version 25.12.0; the page-level reference is labelled Version 25.11.0. Those are separate parameter shapes for different API surfaces—do not assume that every cookie-setting method accepts both shapes. Check the method and types for the Puppeteer version installed in your project.
Rank #2
| Surface | Role | Documented partition-key behavior |
|---|---|---|
CookiePartitionKey |
Key interface | In Chrome, sourceOrigin maps to the top-level site; hasCrossSiteAncestor is optional and Chrome-only. Puppeteer reference. |
CookieData |
Browser-level cookie parameter object | Optional partitionKey, accepted as a CookiePartitionKey or string; Chrome matches it to the top-level site where the partitioned cookie is available. Puppeteer reference. |
CookieParam |
Page-level cookie parameter object | Optional partitionKey. Puppeteer documents different matching semantics for Firefox; its url can also affect default domain, path, and source scheme. Puppeteer reference. |
Set a partitioned cookie using browser-level CookieData
This example uses the browser-context cookie API with a browser-level cookie object. The example assumes the installed Puppeteer version exposes BrowserContext.setCookie with CookieData; verify the method signature against your installed version. Replace the example domains with a real top-level site and embedded service you control. The cookie must be Secure, so use HTTPS.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch({ headless: true });
try {
const context = await browser.createBrowserContext();
const page = await context.newPage();
// The top-level site whose partition should contain the cookie.
await page.goto('https://shop.example', { waitUntil: 'domcontentloaded' });
await context.setCookie({
name: '__Host-widget-session',
value: 'example-value',
url: 'https://widget.example',
secure: true,
path: '/',
sameSite: 'None',
partitionKey: {
sourceOrigin: 'https://shop.example',
hasCrossSiteAncestor: true,
},
});
// Navigate to a page on the same top-level site that embeds widget.example
// to test whether the embedded service receives its partitioned cookie.
await page.goto('https://shop.example/page-with-widget', {
waitUntil: 'domcontentloaded',
});
} finally {
await browser.close();
}
The cookie’s url identifies the embedded service, while partitionKey.sourceOrigin identifies the top-level-site context. Keep these roles distinct. If the request that sets the cookie has no cross-site ancestor, use the appropriate value for hasCrossSiteAncestor; do not set it reflexively. The Puppeteer interface marks it optional, and documents it as Chrome-only.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →CHIPS cookie requirements and boundaries
Chrome’s CHIPS guidance requires Secure on partitioned cookies and recommends the __Host prefix. Its example cookie is:
Set-Cookie: __Host-name=value; Secure; Path=/; SameSite=None; Partitioned;
The equivalent documented JavaScript cookie string is:
Rank #4
Document.cookie="__Host-name=value; Secure; Path=/; SameSite=None; Partitioned;"
These are Chrome’s server-header and JavaScript examples, not Puppeteer method calls. Puppeteer’s cookie parameter uses a partitionKey field to identify the context; use the cookie fields supported by the particular API method you call. CHIPS is for isolated per-top-level-site state, not for sharing one cookie across unrelated sites. Chrome’s documentation also notes that its described Related Website Sets design relies on the Storage Access API and does not integrate with CHIPS partitioning.
Browser differences and version caveats
Do not carry Chrome assumptions over to Firefox. Puppeteer’s CookieParam documentation says Firefox matches the partition key to the source origin in PartitionKey, whereas Chrome uses top-level-site semantics. The same reference documents hasCrossSiteAncestor as Chrome-only.
Best Value
Chrome’s extensions API is a separate interface: its chrome.cookies reference marks partition-key filtering or modification as Chrome 119+ and getPartitionKey() as Chrome 132+. Those markers apply to the extensions API; they do not establish a minimum Puppeteer version. Use the documentation and TypeScript definitions for the exact Puppeteer version and browser you run.
Verify behavior in the right context
- Load the intended top-level site over HTTPS.
- Set the cookie for the embedded service with a partition key for that top-level site.
- Visit a page on that same top-level site that embeds the service, then check the request or browser cookie state.
- Repeat with a different top-level site. A partitioned cookie should not be treated as the same shared third-party state there.
For a controlled check, compare the embedded service’s behavior under each top-level site, rather than merely checking that a cookie with a matching name exists. The partition key is part of the cookie context.
Troubleshooting
- The cookie is rejected or missing: confirm the cookie is set over HTTPS and includes the required
Secureattribute. Chrome’s CHIPS example also usesSameSite=None,Path=/, andPartitioned; for Puppeteer, check that you are using the right parameter shape for the API method. - The cookie appears on one site but not another: that is expected isolation when the top-level-site partition differs. Set or inspect the cookie in the top-level context where the embedded service needs it.
- The TypeScript object is rejected: verify whether the called method expects browser-level
CookieDataor page-levelCookieParam, and consult the installed Puppeteer version’s type definitions. The references document both fields but do not imply every method takes both shapes. - Firefox behaves differently: account for Puppeteer’s documented Firefox source-origin matching semantics. Do not expect Chrome’s
sourceOrigin-to-topLevelSitemapping or Chrome-only ancestor field to transfer unchanged. - A browser extension example does not match Puppeteer:
chrome.cookiesis an extension API with its own version availability; its API version markers do not specify Puppeteer support.
Or skip the browser setup
If your goal is a clean screenshot of a page rather than setting or debugging its cookie partition behavior, ScreenshotNeo can return an image or PDF with one GET request. The service removes cookie/consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 shots a month with no card, and paid plans start at $5 for 3,000.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://shop.example -o shot.webp
See the ScreenshotNeo API documentation for parameters and response details. Sign up for 1,000 free screenshots a month, with no card required.
Recommended Free Tools
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




