Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk4 min

Puppeteer Cookie Priority Explained: What It Does and How to Set It

Puppeteer's optional cookie priority field is Chrome-only and distinct from the attributes that govern cookie scope and sending. Here's how to set it with current APIs.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In Puppeteer, priority is an optional cookie field for Chrome, with values Low, Medium (the default), and High. Treat it as cookie metadata—not as a rule that decides which matching cookie is sent or guarantees that a cookie is kept. Chrome DevTools marks the Priority attribute deprecated. For new code, set cookies through Browser.setCookie() or BrowserContext.setCookie(); Page.setCookie() is obsolete.

What does cookie priority mean in Puppeteer?

Puppeteer exposes priority as an optional cookie property, and its API documentation says it is supported only in Chrome. Chrome DevTools lists three values: Low, Medium, and High, with Medium as the default. DevTools also labels the Priority attribute deprecated. See Puppeteer’s CookieParam and CookieData references and Chrome DevTools’ cookie documentation.

As an Amazon Associate I earn from qualifying purchases.

The word “priority” can sound like request ordering. The documented field does not establish which of two cookies wins when both are eligible for a request, nor does the documentation promise that a high-priority cookie will be retained. Do not use it as a substitute for correct cookie scope or sending attributes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to set a cookie priority with current Puppeteer APIs

Use the browser or browser context that owns the cookie store needed by your navigation or request. A browser context has isolated storage, so setting a cookie in one context does not make it available in another. Puppeteer documents both browser- and context-level cookie methods; its cookie guide covers setting, reading, and deleting cookies. See Puppeteer’s cookie guide and the obsolete Page.setCookie() reference.

#1 Best Overall
Sale
Amazon Basics Wired QWERTY Keyboard, Works with Windows, Plug and Play, Easy to Use with Media Control, Full-Sized, Black
  • KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
  • EASY SETUP: Experience simple installation with the USB wired connection
  • VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
  • SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
  • FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.

Set a cookie on a browser context

This example launches Chrome, sets a high-priority cookie in the default browser context, navigates to the relevant site, reads the cookie store, and closes the browser. Replace the example domain and value with ones appropriate to your test.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
  // Use a Chrome executable when your environment does not default to Chrome.
  // executablePath: '/path/to/chrome',
});

try {
  const context = browser.defaultBrowserContext();
  await context.setCookie({
    name: 'session',
    value: 'example-value',
    domain: 'example.com',
    path: '/',
    secure: true,
    httpOnly: true,
    sameSite: 'Lax',
    priority: 'High',
  });

  const page = await context.newPage();
  await page.goto('https://example.com/', { waitUntil: 'domcontentloaded' });

  console.log(await context.cookies('https://example.com/'));
} finally {
  await browser.close();
}

The example assumes Puppeteer and a compatible Chrome installation are available in the runtime. If using a non-default context, call setCookie() on that same context, then navigate with a page created from it.

Rank #2
Sale
Logitech MK270 Full Size Wireless Keyboard and Mouse Combo - Black
  • Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
  • Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
  • Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
  • Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
  • Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites

Use the browser-level API instead

If you want to set cookies for the browser’s default context, Browser.setCookie() is also a current option:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await browser.setCookie({
  name: 'session',
  value: 'example-value',
  domain: 'example.com',
  path: '/',
  priority: 'Medium',
});

For an isolated test, prefer the explicit context API so it is clear which cookie store receives the cookie. The browser- and context-level APIs do not change the meaning of the cookie’s scope or sending attributes.

Rank #3
Sale
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
  • All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
  • Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
  • Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
  • Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
  • Plastic parts in K120 include 51% certified post-consumer recycled plastic*

Which cookie attributes control whether a cookie applies?

Priority is separate from the cookie properties that define its scope, transport, lifetime, script visibility, or partition. Set those properties according to the behavior you need:

Attribute What it controls
domain and path The hosts and URL paths within scope.
secure Whether the cookie is limited to secure connections.
sameSite Whether the cookie is eligible in same-site or cross-site contexts.
expires Persistent expiration. If omitted, the cookie is a session cookie.
httpOnly Whether JavaScript can access the cookie.
partitionKey In Chrome, the top-level-site context associated with a partitioned cookie.
priority Optional priority metadata; Puppeteer’s API documentation says it is Chrome-only. DevTools lists Low, Medium (default), and High, and marks the attribute deprecated.

For Chrome’s documented behavior, an omitted SameSite value is treated as Lax; cross-site cookies must specify SameSite=None and Secure. That policy is independent of Priority. Consult the Chromium SameSite FAQ for that behavior.

Rank #4
Sale
Redragon K521 Upgrade Rainbow LED Gaming Keyboard, 104 Keys Wired Mechanical Feeling Keyboard with Multimedia Keys, One-Touch Backlit, Anti-Ghosting, Compatible with PC, Mac, PS4/5, Xbox
  • 【Dreamy Rainbow Gaming Keyboard】K521 Gaming Keyboard Adopts a Different LED Backlight Design, Upgraded on the Traditional LED Backlight Effect, Making the Light More Penetrating, Giving You a More Dazzling Visual Effect, Making Your Gaming Process More Enjoyable
  • 【One Touch Opens & Visual Feast】The K521 Red Dragon Keyboard has a One-Touch on/off Lighting Button for Added Convenience. It also has a Three-Position Adjustable Breathing Mode and a Four-Position Adjustable Brightness Lighting Mode
  • 【Mechanical Feeling & Fast Tapping】The PC Keyboard Keys are Designed for Mechanical Feeling, Giving You a Better Feel During Use and the Ability to Trigger Keys Quickly, Allowing You to Win All Your Games
  • 【19 Keys Anti-Ghosting Keyboard】Anti-Ghosting Ensures Every Button Can Be Triggered. This Allows You to Trigger Key Combinations In The Game Accurately, And Each Skill Can Be Accurately Released to Increase Your Winning Rate. Redragon K521 Will Be Your Perfect Partner
  • 【12 Multimedia Combination Keys】The K521 Wired Gaming Keyboard is Equipped with 12 Multimedia Keys That Can Greatly Enhance Your Gaming/Office Efficiency and Make It More Convenient to Use

Does priority decide which cookie Puppeteer sends?

No such rule is established by the cited Puppeteer and Chrome documentation. Whether a cookie is eligible for a request depends on its scope and sending conditions—such as domain, path, Secure, and SameSite—not on treating priority as a matching-cookie tie-breaker. Likewise, the documentation reviewed does not establish a complete current eviction algorithm or guarantee that High prevents eviction. If correctness depends on a cookie being present, verify it in the intended context rather than relying on its priority value.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Common problems and fixes

  • The cookie is missing after navigation: Confirm the page was created in the context where you set the cookie. Contexts have isolated storage. Check that the target URL matches the cookie’s domain and path, and that Secure and SameSite conditions allow sending.
  • The cookie is rejected or behaves unexpectedly on a cross-site request: Check SameSite separately from Priority. In Chrome’s documented behavior, cross-site cookies require SameSite=None and Secure.
  • The priority field has no effect in another browser: Puppeteer’s API reference documents priority as Chrome-only. Do not assume another browser implements the field.
  • A tutorial reports that page.setCookie() is obsolete: It is. Use browser.setCookie() or context.setCookie() instead.
  • A high-priority cookie is still missing: High is not a documented guarantee of retention or request eligibility. Inspect the cookie’s other attributes and the context, and do not infer a complete eviction policy from the priority label.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If the goal is to capture a website rather than test cookie behavior in Puppeteer, ScreenshotNeo provides a one-request screenshot API. It accepts consent banners like a visitor 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. Its MCP server gives AI agents screenshot tools, and the API also supports PDF capture.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for the free plan.

Quick Recap

SaleBestseller No. 1
SaleBestseller No. 3
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Plastic parts in K120 include 51% certified post-consumer recycled plastic*; Product carbon footprint: 4.02 kg CO2e
$12.39
SaleBestseller No. 5
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Plastic parts in K270 include 38% certified post-consumer recycled plastic; Eight hot keys: For instant access to the Internet, e-mail, music volume and more
$21.48
Best Value
Sale
Logitech K270 Full Size Wireless Keyboard for Windows - Black
  • All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
  • Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
  • Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
  • Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
  • Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.