I am trying to get the cookies in the pre request script to chain it with other request which returns as empty array using the example below.
With the latest release of postman v8, the cookies object cannot be fetched using the pm.sendRequest which would otherwise work in postman versions less than 8.
pm.sendRequest(url, function (err, response, { cookies }) {
console.log(cookies.all());
});
I think you might need something like this to see the cookies:
pm.sendRequest("https://postman-echo.com/get", function (err, response, options) {
console.log(options.cookies.members);
});
From here you could loop through the members
array to get what you need.