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 manipulate them as per your needs to be used in subsequent requests.
Hope this helps, feel free to reach out in case you have additional querries.