I want to delete the cookies from Postman using test cases.
Cookie jar isnât working. Please help.
Hey @ksingh778
Welcome to the community!
Whatâs ânot workingâ for you?
Could you walk us through the process and share some images of what youâre seeing.
If your using some code in the tests tab, could you also share this please.
Without more information itâs going to be difficult to suggest a solution.
More information about cookies can be found here:
https://learning.postman.com/docs/sending-requests/cookies/
Getting the following error:
Error: CookieJar store is not synchronous; use async API instead
After hitting a request I got 3 cookies. I have to verify the cookie creation for which I can use pm.cookies.has(âcookienameâ).
Then I have to clear these cookies, so that these cookies doesnât alter the next hit. I want to do this through tests.
To get programmatic access to the cookies - you would first need to whitlist the domain.
After doing this you should be able to use the functions list on that part to clear out the cookies.
Can you share your test code so we can see what you have so far, thatâs always better than trying to explain whatâs in the Test sandbox
@danny-dainton - I have the same issue. I whitelisted the domains, restared my Postman and Iâm trying to use the below piece of code to delete cookies and its giving me error âError: CookieJar store is not synchronous; use async API instead.â Iâm using Postman v8.5.0 version of Postman. I have this script in my Pre-requisite tab. let cookieJar = pm.cookies.jar();
console.log(cookieJar);
Note:If I remove the console.log line, I donât see any error.