# cookies

Create and capture cookies using Postman's cookie manager
========================================================

Postman's cookie manager enables you to view and edit cookies that are associated with different domains. You can manually create cookies for a domain, or you can [capture cookies](/docs/sending-requests/capturing-request-data/syncing-cookies/) using the Postman proxy or Postman Interceptor. You can then use the cookies stored in the Postman cookie jar when sending requests in Postman.

To turn off sending cookies with a request, select the request's **Settings** tab, then select **Disable cookie jar**.

## About cookies

A _cookie_ is a packet of data that a computer receives and then sends back without changing or altering it. Most cookies have two pieces of data: a unique ID for each user and a site name.

Websites can retrieve the cookie when you revisit them, so they can remember you and your preferences and tailor page content for you based on this information. Without cookies, you'd have to sign in again after you leave a site or rebuild your shopping cart if you closed a web page. This makes cookies an important part of the internet experience.

## Use the cookie manager

To manage cookies in Postman, open a request, then select **Cookies** (under **Send**).

![Cookies link](https://assets.postman.com/postman-docs/v11/cookies-link-v11-b.jpg)

In the **Cookies** window, select the **Manage Cookies** tab to display a list of domains and the cookies associated with each one. If you want to view cookies for a domain that isn't in the list, you can [add a domain](#add-a-domain).

![Managing cookies](https://assets.postman.com/postman-docs/v11/manage-cookies-v11-1.jpg)

## Add a domain

To add a new domain to the cookie manager, do the following:

1. Select the **Type a domain name** search box.
1. Enter the domain name. If you enter a protocol (such as `http://`) or port number, they won't be stored with the domain name in the cookie manager.
1. Select **Add domain**.

## Create cookies

To add a new cookie for a domain, select \u003cimg alt=\"Add icon\" src=\"https://assets.postman.com/postman-docs/aether-icons/action-add-stroke.svg#icon\" width=\"16px\"\u003e **Add Cookie** under the domain. A pre-generated cookie string compliant with [HTTP State Management standards](https://datatracker.ietf.org/doc/html/rfc6265#section-4.1) is created.

```js
Cookie_1=value; Path=/; Expires=Wed, 09 Oct 2024 21:49:26 GMT;
```

Postman supports the following attributes:

* **cookieName** = **cookieValue** - The name of the cookie and its stored value.
* **Domain** - The domain Postman will send the cookie to.
* **Path** - The URL path that the cookie is restricted to. If the path is `/`, the cookie will be sent to all requests in the specified domain.
* **HttpOnly** - If present, the cookie won't be available to the client-side scripts run on the page (for example, with `document.cookie` in JavaScript). The cookie will only be added to the cookie header in requests that are made. This field doesn't have an effect on Postman's behavior.
* **Secure** - If present, the cookie is only sent when the URL begins with `https://` and won't be sent over an insecure connection.
* **Expires** - The time after which the cookie expires and won't be sent by Postman.

Select **Save** to save the cookie to the Postman cookie jar under the relevant domain.

Postman doesn't support the `SameSite` attribute, or the `__Secure-` and `__Host-` prefixes.

You can also add or edit the cookies in a response with the [Set-Cookie header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie).

## Edit or delete cookies

To update an existing cookie for a domain, select the cookie you want to edit, edit any attribute, then select **Save**.

To delete a domain and all cookies associated with it, select \u003cimg alt=\"Close icon\" src=\"https://assets.postman.com/postman-docs/aether-icons/action-close-stroke.svg#icon\" width=\"16px\"\u003e next to the domain. To delete an individual cookie, select \u003cimg alt=\"Close icon\" src=\"https://assets.postman.com/postman-docs/aether-icons/action-close-stroke.svg#icon\" width=\"16px\"\u003e next to the cookie.

To remove all cookies and domains from the Postman cookie jar, select **Clear All Cookies**.

## Send cookies with a request

When you make a request to a domain you have added a cookie to, the cookie automatically appears in your request **Headers** tab. If the cookie isn't visible, select **hidden** to show autogenerated headers.

![Cookie header](https://assets.postman.com/postman-docs/v11/autogenerated-cookie-header-v11-b.jpg)

You can't override cookie headers directly in the **Headers** tab. Edit the cookie in the cookie manager, or delete the cookie and set your request headers manually. You can add cookies in the cookie manager and the **Headers** tab, and Postman will merge the cookies before sending the request.

## Script with cookies

You can write scripts that create, get, and delete cookies, giving you more control over your cookies. Use the `pm.cookies` object to access cookies associated with the request. Use the `pm.cookies.jar()` methods to create, get, and delete cookies for a specific domain. To access cookies for specific domains using the `pm.cookies.jar()` methods, you must first [add domains to the allowlist](#access-cookies-in-scripts).

Learn more about [writing scripts that create, get, and delete cookies](/docs/tests-and-scripts/write-scripts/postman-sandbox-reference/pm-cookies/).

### Access cookies in scripts

When you add a domain to the allowlist, cookies for that domain can be accessed in scripts using the `pm.cookies.jar()` methods.

To add a domain to the allowlist, do the following:

1. In the **Cookies** window, select **Domains Allowlist**.
1. Select **Add a domain to the Allowlist**.
1. Enter the allowed domain. If you include anything other than the domain name, such as a protocol, you won't be able to access cookies for that domain.
1. Select **Add**.

To remove a domain from the allowlist, select \u003cimg alt=\"Close icon\" src=\"https://assets.postman.com/postman-docs/aether-icons/action-close-stroke.svg#icon\" width=\"16px\"\u003e next to the domain.

![Manage cookies domains allowlist](https://assets.postman.com/postman-docs/v11/domains-allowlist-cookies-v11.jpg)

## Sync cookies

Postman can capture cookies for a browser or client application using the [Postman proxy](/docs/sending-requests/capturing-request-data/capture-with-proxy/) or [Postman Interceptor](/docs/sending-requests/capturing-request-data/interceptor/). For the domains you select, captured cookies are continuously synced with the Postman cookie jar. This enables you to use any authentication sessions in your browser or client application to make API calls in Postman.

Learn more about [capturing cookies with the Postman proxy or Postman Interceptor](/docs/sending-requests/capturing-request-data/syncing-cookies/).

## Feature availability

The following features require the Postman desktop app:

* **Open Postman Vault from public workspaces** - You must use the Postman desktop app to open your Postman Vault from a [public workspace](/docs/collaborating-in-postman/using-workspaces/public-workspaces/), and reference vault secrets in a public workspace. If you're using the Postman web app, you must add new vault secrets to your Postman Vault if you're opening it from a public workspace.
* **Create and manage Postman Vault integrations** ([Enterprise teams only](https://www.postman.com/pricing/)) - You can create a new integration. To learn more, see [Create custom properties for Stripe](#create-custom-properties-for-stripe).
* **Create Organization Teams** - You can create a Team and invite other Team Members to it. For more information, see [Creating organization teams and workspaces](/docs/administration/organization/create/).
* **Manage team members** - You can add, remove, and manage team members. For more information, see [Team members](/docs/administration/managing-your-team/team-members/overview/).
* **Manage team resources** - You can add, remove, and manage team resources. For more information, see [Team resources](/docs/administration/managing-your-team/manage-team-workspaces/).
* **Manage product access** - You can add, remove, and manage product access. For more information, see [Team product access](/docs/administration/managing-your-team/manage-team-product-access/).
* **Manage security** - You can manage security settings. For more information, see [Security](/docs/administration/managing-your-team/overview/#secure-your-postman-team).

## Troubleshoot vault secrets

Vault secrets can be empty or unresolved in your HTTP requests. An *empty vault* secret is a vault secret that doesn't have a value but is referenced in your request. An empty vault secret may or may not exist in your Postman Vault. An *unresolved vault secret* is a vault secret that exists in your Postman Vault but the value can't be accessed from your request.

A vault secret in a cloud vault may be empty if the cloud vault's name was updated, but references to the vault secret use the previous cloud vault name. To fix this, update references to the vault secret with the correct cloud vault name.

To configure HubSpot to process data from Stripe, create new properties in HubSpot based on the flows you plan to run.

### Add new Stripe customers to HubSpot

To configure HubSpot to process data from Stripe about new customers, do the following:

1. In HubSpot, navigate to **Settings > Properties**.
2. Select **Contact properties > Create property**.
3. Create the following custom property:
    * `stripe_id`
    * `stripe_customer_id`

### Add new Stripe subscriptions to HubSpot contacts list

To configure HubSpot to process data from Stripe about new subscriptions, do the following:

1. In HubSpot, navigate to **Settings > Properties**.
2. Select **Contact properties > Create property**.
3. Create the following custom property:
    * `stripe_id`
    * `stripe_customer_id`
    * `stripe_currency`
    * `stripe_period_end`
    * `stripe_period_start`
    * `stripe_total`
    * `stripe_customer_email`

### Create or update HubSpot contacts for new Stripe subscriptions

To configure HubSpot to process data from Stripe about new subscriptions, do the following:

1. In HubSpot, navigate to **Settings > Properties**.
2. Select **Contact properties > Create property**.
3. Create the following custom property:
    * `stripe_id`

### Create or update HubSpot contacts with new Stripe payments

To configure HubSpot to process data from Stripe about new payments, do the following:

1. In HubSpot, navigate to **Settings > Properties**.
2. Select **Contact properties > Create property**.
3. Create the following custom properties:
    * `stripe_id`
    * `stripe_customer_id`
    * `stripe_currency`
    * `stripe_amount`
    * `stripe_customer_email`

## Next steps

After you've completed your Stripe configuration, you can return to the flow template or set up authorization for another integration in Postman.

* [Set up HubSpot authorization for Postman Flows](/docs/postman-flows/templates/hubspot-setup/)
* [Set up Mailchimp authorization for Postman Flows](/docs/postman-flows/templates/mailchimp-setup/)
* [Set up Notion authorization for Postman Flows](/docs/postman-flows/templates/notion-setup/)
* [Set up Slack authorization for Postman Flows](/docs/postman-flows/templates/slack-setup/)
* [Set up Stripe authorization for Postman Flows](/docs/postman-flows/templates/stripe-setup/)