jed / cookie-node

signed cookie functionality for node.js
MIT License
82 stars 10 forks source link

Multuple cookies do not supported #7

Open sparfenyuk opened 14 years ago

sparfenyuk commented 14 years ago

If you want to set multiple cookies you will see that this is impossible. The problem is described in this post http://caolanmcmahon.com/multiple_set_cookie_headers_in_node_js.html

jwatte commented 14 years ago

I see the same problem.

It seems as if it appears to set many cookies in a single Set-Cookie header, but the browser somehow doesn't like it. (I'm using Firefox 3.6 on Ubuntu)

jwatte commented 14 years ago

OK, so this seems simple to fix. The cookie spec says that multiple cookies, as well as parameters, are separated by semicolons only. The cookie-node library separates different cookies with ', '. That should be a single space: " ". Line 92 in index.js, "cookies.join()" should not take a comma.