Last updated: Apr 5, 2024
Reading time·3 min
To clear the cookies or delete a specific cookie in Postman:
X
icon next to a domain, all cookies for the domain are deleted.You can also manually clear your cookies or delete specific cookies in your browser which also removes the cookies from Postman.
For example, in Chrome:
F12
or right-click and click Inspect to open your developer
tools.Expand the Cookies menu in the left sidebar under Storage.
Right-click on the specific domain and select clear to clear all cookies for the given domain.
If you only want to delete a specific cookie, right-click on the cookie and select Delete.
If the cookies aren't synced in Postman after deleting them in the browser, reissue the HTTP request.
You can also clear the cookies in Postman by using the DevTools:
Click on Show Devtools (Current View).
In the Developer Tools window, click on the Application tab.
Expand the Cookies menu in the left sidebar.
Right-click on the https://dekstop.postman
domain and click on Clear.
You can also delete a specific cookie by right-clicking on it in the window on the right and selecting Delete.
You can also use a pre-request script to programmatically delete the cookies before a request is sent.
const jar = pm.cookies.jar(); jar.clear(pm.request.url, function (error) { // error - <Error> });
The code clears all cookies for the domain and is run before the request is sent.
If you still aren't able to clear the cookies, try whitelisting the domain.
There is also a pre-request script that allows you to remove a specific cookie before issuing an HTTP request.
const jar = pm.cookies.jar(); jar.unset(pm.request.url, 'cookie name', function (error) { // error - <Error> });
If you need to prevent cookies used in a given request from being stored in the Postman cookie jar:
Click on the Settings button for the specific request.
Click on the Disable cookie jar setting to enable it.
When the setting is enabled, cookies for the specific request are not stored in the cookie jar and existing cookies in the cookie jar are not added to the request headers.
You can learn more about the related topics by checking out the following tutorials: