I'm writing a Postman collection to be executed in Postman Runner, which requires that cookies from a first request be used in subsequent requests.
In curl, you can achieve this like so
curl -d "username=x&password=y" -c logincookie.txt https://service.com/login
curl -b logincookie.txt https://service.com/x/profile
I can't seem to do this in Postman.
As documented, in my test for the first request I save the cookie as an environment variable
var login_cookie = postman.getResponseCookie("LOGIN");
postman.setEnvironmentVariable("login_cookie", login_cookie);
and then, as described in this blog post, I add the following header to the subsequent request,
Cookie: {{login_cookie}}
but the server responds to this request as if the cookie was not provided.
How can I pass the cookie from the first response to the second request?
I'm using the Postman for Mac 4.10.7 and have enabled the interceptor with its default settings, although I don't know how to validate that this actually works!