You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When parsing a cookie, I can see all the properties but how can realize which key represents the cookie name? I want to iterate over all http response cookies and act on a specific cookie, this why I need its name
Thanks!
Yoni
The text was updated successfully, but these errors were encountered:
Hi @Yonatannn I'm not sure what you mean; when you pare the Cookie HTTP header, you get an object back, where each key is the name of the cookie and each value is the cookie's value. You can iterate over all the properties using for in, for example:
varcookies=cookie.parse('foo=bar; equation=E%3Dmc%5E2');for(varnameincookies){console.log('cookie name = "%s", cookie value = "%s"',name,cookie[name])}
Ah, sorry, didn't realize. Yea, currently this module parse method only understands the format of the Cookie header. If you are inferested in formulating a pull request to add Set-Cookie parsing, that would be welcome, though you're always welcome to use a different module to accomplish your task if you are not tied to using this one :)
Hi,
When parsing a cookie, I can see all the properties but how can realize which key represents the cookie name? I want to iterate over all http response cookies and act on a specific cookie, this why I need its name
Thanks!
Yoni
The text was updated successfully, but these errors were encountered: