Skip to content


Retrieve cookies from server response #379

spiffytech opened this Issue · 7 comments

6 participants


How can I retrieve the cookies returned by the server I call out to with request?


You can use your own jar and then read them, i.e.

var jar = request.jar();
jar: jar



I'm getting undefined when I do jar.cookies

request member

you could take a look at the response's headers for Cookie res.headers i believe. Alternatively you could use jar.getCookieString(YOUR_URL_HERE)


this is how I retrieve cookies: receiveCookie = response.headers['set-cookie'][x]
then I use cookie = toughCookie.Cookie.parse(receiveCookie)
and jar.setCookie(cookie ....
this works form me :)


thanks. i think jar.setCookie will take the original receiveCookie though? or am i wrong about that.


yes, but I need to parse "receiveCookie" in other to get things work ... this is the solution I found

request member

Is this still an issue?

This is so old I'm closing, if it is actually still an issue just let me know and I'll re-open.

@mikeal mikeal closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.