For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Postman
PricingEnterprise
Contact SalesSign InSign Up for Free
    • Help
      • Overview
        • How to dynamically set the initial value for a variable
        • How to persist variable values
        • How to dynamically update multiple requests
        • How to add a proxy to the operating system
        • I'm experiencing a long response time
        • How to install Newman
        • How to use cookies in scripts
        • How to save a response as a variable and reuse it for another API call
Postman API Platform

Product

  • Postman Overview
  • Enterprise
  • Spec Hub
  • Flows
  • Agent Mode
  • API Catalog
  • Fern
  • Postman CLI
  • Integrations
  • Workspaces
  • Plans and pricing

API Network

  • App Security
  • Artificial Intelligence
  • Communication
  • Data Analytics
  • Database
  • Developer Productivity
  • DevOps
  • Ecommerce
  • eSignature
  • Financial Services
  • Payments
  • Travel

Resources

  • Postman Docs
  • Academy
  • Community
  • Templates
  • Intergalactic
  • Videos
  • MCP Servers

Legal and Security

  • Legal Terms Hub
  • Terms of Service
  • Postman Product Terms
  • Security
  • Website Terms of Use

Company

  • About
  • Careers and culture
  • Contact us
  • Partner program
  • Customer stories
  • Student programs
  • Press and media
Twitter iconLinkedIn iconGithub iconYouTube iconInstagram iconDiscord icon
Download Postman
Privacy Policy

© 2026 Postman, Inc.

FAQsSending requests

How to use cookies in scripts

||View as Markdown|
Was this page helpful?
Previous

How to install Newman

Next

How to save a response as a variable and reuse it for another API call

Built with

Postman stores cookies inside a Cookie Manager and the stored cookies can be accessed when writing scripts in Postman.

The access to cookies inside scripts is exposed thanks to a cookie jar and you can use that cookie jar to work with cookies inside your scripts.

  1. Select a request > Cookies .
  2. Select the Domains Allowlist button and add a domain name. This will allow the domain’s cookies to be accessed in the scripts.
  3. Create a Cookie jar in your script.
const cookieJar = pm.cookies.jar();cookieJar.getAll(URL, callback(error, cookies)); // *Optional* This line will retrieve all stored cookies
  • Note: You can use the cookie jar to Get, Delete, Create or Update cookies. To learn more, you will find further operations you can perform on the cookie jar in the Learning Center .

Have more questions? Submit a request