Can Cookies be sent with newman requests?

Hi

We run a collection in postman and set a cookie for each request. When I export the collection and run with newman I am seeing errors that suggests this isn’t happening when run using newman. I can’t find anything in the collection json either that would suggest the cookies we have in postman are exported for use by newman.

Is it possible to run our collection with our cookie in newman as we do in postman?

Thanks

Ben

Hi @ben

I see that you’ve raised this as a ticket internally and the suggested workaround has helped :slight_smile:

Posting the same to help the ones looking for the solution:

There isn’t a way to export cookies from the app as of now. The workaround is to add cookie header (like Cookie: <name>=<value>) manually in the request and then export the collection

else

you can also use the below script in the pre-request script tab and then export the collection.

pm.request.headers.add({
key: ‘Cookie’,
value: ‘=’
});

@Kurmavatar Sorry to resurrect this thread, but I’m confused about your answer. You say there isn’t a way to export cookies from the app, but the workaround given sounds like that’s exactly what it does? I tried adding a new cookie both via the cookie manager and by adding a new header, but neither showed up in the exported json. I’m using Postman 8.11.1.