Cookies not saved when using npm request library Cookies not saved when using npm request library express express

Cookies not saved when using npm request library


The request library documentation doesn't mention the withCredentials option but setting it to true fixes the issue. The cookie now gets saved and is being sent on subsequent requests.

const requestBase = request.defaults({  baseUrl: 'http://app.dev:4000/',  withCredentials: true,});