I am using node.js request
module to fetch an id_token from an API. After fetching that id_token I want to send a redirect uri
response with a se
After lots of trials and errors and googling I was finally able to achieve my goal. In order to send a cookie with an expiry to the the redirect URL, I just added
s = body.exp.toUTCString();
res.cookie('id_token' ,body.id_token, {expires: s});
res.redirect(302, 'http://localhost:8080');
in express 4.16.3 , you must set
res.cookie()
before
res.redirect()
and it works for me, without error