# How to capture cookies value from Cookies and pass it under Headers?

**URL:** <https://community.postman.com/t/how-to-capture-cookies-value-from-cookies-and-pass-it-under-headers/4939>\
**Category:** Help Hub\
**Created:** [April 10, 2019, 6:29pm UTC](https://community.postman.com/t/how-to-capture-cookies-value-from-cookies-and-pass-it-under-headers/4939 "2019-04-10T18:29:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jetison](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/jetison/32/12_2.png) [@jetison](https://community.postman.com/u/jetison)\
**Post date:** [April 10, 2019, 9:30pm UTC](https://community.postman.com/t/how-to-capture-cookies-value-from-cookies-and-pass-it-under-headers/4939/2 "2019-04-10T21:30:29Z")

</div>

This post shows you how you can do it in the [Postman sandbox](https://learning.getpostman.com/docs/postman/scripts/postman_sandbox):

> [@Passing cookies/headers between requests](https://community.postman.com/t/passing-cookies-headers-between-requests/2554/3):
>
> Hey @rgasioro. Sorry for the delay in response, answering here in case someone stumbles upon it in the future. The sandbox actually exposes a pm.cookies.toObject() function. From the docs: Get a copy of all cookies and their values in the form of an object. The cookies returned are the ones defined for the requested domain and path. So you’d get all the cookies as an object in this format: { cookieName: 'cookieValue' } Once you get this, you can iterate over the object keys and manipula…

---

_[View the full topic](https://community.postman.com/t/how-to-capture-cookies-value-from-cookies-and-pass-it-under-headers/4939)._
