*** title: How to use cookies in scripts description: >- Postman stores cookies inside a Cookie Manager and the stored cookies can be accessed when writing scripts in Postman. The access to cookies inside scripts i... ---- Postman stores cookies inside a [Cookie Manager](/docs/sending-requests/response-data/cookies/) and the stored cookies can be accessed when writing scripts in Postman. The access to cookies inside scripts is exposed thanks to a cookie jar and you can use that cookie jar to work with cookies inside your scripts. 1. Select a request > **Cookies** . 2. Select the [Domains Allowlist](/docs/sending-requests/response-data/cookies/#access-cookies-in-scripts) button and add a domain name. This will allow the domain’s cookies to be accessed in the scripts. 3. Create a Cookie jar in your script. ``` const cookieJar = pm.cookies.jar();cookieJar.getAll(URL, callback(error, cookies)); // *Optional* This line will retrieve all stored cookies ``` * **Note:** You can use the cookie jar to Get, Delete, Create or Update cookies. To learn more, you will find further operations you can perform on the cookie jar in the [Learning Center](/docs/tests-and-scripts/write-scripts/postman-sandbox-reference/overview/#script-with-request-cookies) . *** Have more questions? [Submit a request](/help/submit-request) ***