The cookies are information sent by the server and stored in the browser. As soon as a request is sent, the cookies are returned by the server. In Postman, the cookies are mentioned under the Headers and Cookies tab in the Response.

Let us apply a GET request on an endpoint and find the cookies.

In the Headers tab, the cookie sent by the server is set with the key − set−cookie.

In the Cookies tab, the same cookie details will also get displayed.

Step 1 − Click on the Add Cookie button. A text box shall open up with pre-existing values inside it. We can modify its values and then click on Save.

Step 2 − Send the request again to the server.

Cookies can be handled programmatically without using the GUI in Postman. To work with cookies, we have to first generate a Cookie jar. It is an object which has all the cookies and methods to access them.

The syntax for Cookie Jar Creation is as follows −

const c = pm.cookies.jar();


We can create a cookie with the .set() function. It accepts URL, name of cookie, value of cookie as parameters.

The syntax for cookie creation is as follows −

const c = pm.cookies.jar();


We can get a cookie with the .get() function. It accepts the URL, name of cookie as parameters. It yields the cookie value.

The syntax for getting a cookie is as follows −

const c = pm.cookies.jar();


We can get all cookies of a specific URL within a Cookie jar with the .getAll() function. It accepts a URL as a parameter. It yields all the cookie values for that URL.

The syntax for getting all cookies is as follows −

const c = pm.cookies.jar();


We can delete a cookie with the .unset() function. It accepts the URL, name of cookie to be deleted as parameters.

The syntax for deleting cookie is as follows −

const c = pm.cookies.jar();


const c = pm.cookies.jar();