Access to cookie jar denied

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.

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?

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

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);
});


You should add domain into the allowlist.