R01010010 R01010010 - 1 year ago 55
Node.js Question

Express 4, how to see all cookies being sent in res

Hi all i'm using Express 4 with cookie-parser. For some reason the cookie is being set in the

object, but is not really stored in the browser. I wanted to see ALL cookies that are about to be passed at the end (all cookies for the current
object). Any idea on how to get them?

Answer Source

Use this:

console.log('Cookies: ', res._headers["set-cookie"]);

Explanation: As the cookies are set in the response header as "set-cookie" attribute.