# Access to cookie jar denied

**URL:** <https://community.postman.com/t/access-to-cookie-jar-denied/24387>\
**Category:** Help Hub\
**Created:** [June 2, 2021, 3:14am UTC](https://community.postman.com/t/access-to-cookie-jar-denied/24387 "2021-06-02T03:14:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkevinburton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/rkevinburton/32/273_2.png) [@rkevinburton](https://community.postman.com/u/rkevinburton)\
**Post date:** [June 2, 2021, 3:14am UTC](https://community.postman.com/t/access-to-cookie-jar-denied/24387/1 "2021-06-02T03:14:36Z")

</div>

I have the following as part of a pre-request script in the attempt to read cookies and transfer them so they are part of every request and I can automate testing of my APIs.

```auto
const jar = pm.cookies.jar();
jar.getAll('/', (error, cookies) =>
    {
        if (error) {
            console.log(error);
        } else {
            console.log(cookies);
        }
    });

```

The problem is that I get an error with a message property ‘CookieStore: programmatic access to “” is denied’. I am running this Postman request on localhost and I have “whitelisted” localhost as defined in the documentation. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![navin.m](https://avatars.discourse-cdn.com/v4/letter/n/76d3ee/32.png) [@navin.m](https://community.postman.com/u/navin.m)\
**Post date:** [July 22, 2021, 4:47am UTC](https://community.postman.com/t/access-to-cookie-jar-denied/24387/2 "2021-07-22T04:47:44Z")

</div>

Even I am getting the same error inspite whitelisting ip.

const jar = pm.cookies.jar();

jar.clear(pm.request.url, function (error, cookies) {  
console.info(error);

});

message in console  
CookieStore: programmatic access to “” is denied

---

<div class="post-metadata">

**Author:** ![codrutsilviu](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@codrutsilviu](https://community.postman.com/u/codrutsilviu)\
**Post date:** [February 3, 2022, 7:15am UTC](https://community.postman.com/t/access-to-cookie-jar-denied/24387/3 "2022-02-03T07:15:28Z")

</div>

I **whitelisted** the cookie and after that, this code worked in Tests.  
_const jar = pm.cookies.jar();_  
_jar.clear(pm.request.url, function (error) {_  
_console.log(error);_  
_});_

---

<div class="post-metadata">

**Author:** ![kissfz](https://avatars.discourse-cdn.com/v4/letter/k/0ea827/32.png) [@kissfz](https://community.postman.com/u/kissfz)\
**Post date:** [January 11, 2024, 1:28am UTC](https://community.postman.com/t/access-to-cookie-jar-denied/24387/4 "2024-01-11T01:28:16Z")

</div>

![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/e/fe94e2a534aeb079973ae9d21ba7241bf374c18d.png)  
You should add domain into the allowlist.

---

<div class="post-metadata">

**Author:** ![payload-cosmonaut-97](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/payload-cosmonaut-97/32/29522_2.png) [@payload-cosmonaut-97](https://community.postman.com/u/payload-cosmonaut-97)\
**Post date:** [July 26, 2024, 5:11am UTC](https://community.postman.com/t/access-to-cookie-jar-denied/24387/5 "2024-07-26T05:11:33Z")

</div>

I have tried the solutions like allowing or whitelisting domain or reinstalling the postman.  
Upon trying to reinstall, I have found that, I have been using Interceptor to sync browser cookies of domain in postman, which created the access denied issue as you are trying to delete the cookies that the Interceptor has synced.

So try to disable the sync cookies using Postman Interceptor in postman and remove its browser extension (Postman Interceptor). Which solved me this issue.
