Free tools Windows power users keep installed
One-click scans. No signup required.
Puppeteer can write a cookie to a browser context and read cookies stored there. That does not guarantee a browser will send the cookie in a third-party context, such as an embedded frame or cross-site request: storage and cross-site delivery are separate behaviors governed by the browser and site. Use Puppeteer’s BrowserContext cookie methods, then verify the request or frame you actually care about.
Set a cookie in the context you are testing
The Puppeteer documentation labeled “Next” shows direct cookie storage operations. For an isolated test, create a BrowserContext, open the page in that context, and set and inspect the cookie on the same context:
As an Amazon Associate I earn from qualifying purchases.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
const context = await browser.createBrowserContext();
const page = await context.newPage();
// Use the actual cookie name, value, and domain for your authorized test.
await context.setCookie({
name: 'example',
value: 'test-value',
domain: 'third-party.example',
path: '/',
secure: true,
httpOnly: true,
sameSite: 'None',
});
await page.goto('https://first-party.example');
console.log(await context.cookies());
await context.close();
await browser.close();
This writes a cookie into browser storage; it is not a universal third-party-cookie override. In particular, SameSite=None does not by itself guarantee that a browser or website will allow the cookie in every embedded or cross-site situation. Puppeteer’s API documentation describes storage operations, not a mechanism to force third-party acceptance. Policy may vary with browser, version, settings, and site.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Choose the API for the right browser context
Cookies belong to the browser context used by the page. Puppeteer documents that contexts isolate storage, including cookies and localStorage; cookies are not automatically shared between separate contexts.
#1 Best Overall
- Isolated context: use
context.setCookie(...)andcontext.cookies()for pages created from that context. - Default context: use
browser.setCookie(...)andbrowser.cookies()when working with the default BrowserContext. Browser-level cookie methods operate on that default context.
Keep the page, cookie write, and cookie inspection in the same context. A cookie in one context will not appear in another merely because both contexts belong to the same Browser instance.
Verify delivery, not just storage
If context.cookies() returns the cookie, the storage write succeeded. It does not establish that a cross-site request includes it. Test the specific frame or request: inspect the request’s cookie header or the server-side result, and confirm that the request is occurring under the same browser context and conditions as your intended use. A cookie visible in storage but missing from a request points to delivery policy or request context, not necessarily a failed Puppeteer write.
Cookies marked HttpOnly are not readable by page JavaScript, so use Puppeteer’s context cookie API or server-side request evidence to verify them rather than relying on document.cookie. This example targets the documented Puppeteer “Next” API; the guide and API references consulted track current documentation, so check the signatures against the exact release installed in your project.
Use current cookie methods, not deprecated Page methods
Puppeteer marks page.cookies() and page.setCookie() deprecated and directs users to the Browser or BrowserContext cookie methods. Prefer the context methods for isolated tests and the browser methods for the default context. See the Puppeteer cookie guide, BrowserContext API, and Browser API.
Rank #3
Troubleshoot missing third-party cookies
- The cookie is absent from
context.cookies(). Confirm the write used the same BrowserContext as the page, and that the cookie’s name, domain, path, and other attributes match the test. - The cookie appears in storage but not in the request. Inspect the actual frame or cross-site request and browser policy. A successful storage write does not prove third-party delivery.
- The page cannot read a cookie marked
HttpOnly. That is expected; inspect browser storage through Puppeteer or verify the request at the receiving server. - Code using
page.setCookie()orpage.cookies()raises deprecation concerns. Replace those calls with the corresponding BrowserContext or Browser methods. - Behavior differs from another run or browser. Record the browser version, settings, site, and request context. The documented APIs do not establish a universal policy across browsers or sites.
Or skip the browser setup
For a website screenshot rather than a Puppeteer cookie-delivery test, ScreenshotNeo provides a one-call screenshot API. It accepts cookie and browser options, but it is not a way to force third-party cookies to be accepted. For API details, see the ScreenshotNeo documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and responses indicate the page verdict and billing status. An MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots.
Sign up free for 1,000 screenshots a month, with no card required.
Recommended Free Tools
Quick Recap
Best Value
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.




