R01010010 R01010010 - 10 months ago 34
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?


Use this:

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

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