How to clear cookie after an Request

I have a use case’s, where I need to clear cookies after some set of requests.
but when I ran suite, cookies of 1 request is getting stored and the same cookie is being passed automatically in request headers.
this is causing all requests failing.

I used below script to clear the cookie but the cookie is still being stored

const jar = pm.cookies.jar();
jar.getAll(pm.request.url, function (error, cookies) {
// error -
// cookies -


jar.clear(pm.request.url, function (error) {
// error -

Can someone help here?

Have you whitelisted the domain?

You wouldn’t be able to get programmatic access to the cookies without doing that first.