Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression can only set one value #20

Closed
think-free opened this issue Nov 20, 2012 · 7 comments
Closed

Regression can only set one value #20

think-free opened this issue Nov 20, 2012 · 7 comments

Comments

@think-free
Copy link

With last update I can only set one cookie at a time :

This :

                    var cookies = new Cookies( req, res, null );

                    cookies.set( "user", user, {  httpOnly: true } )
                    cookies.set( "session", session, {  httpOnly: true } );

                    res.json({status : "ok"});

work with previous version but not by the last one.

Only the last (session one) set works ...

@jed
Copy link
Contributor

jed commented Nov 22, 2012

well, that's no good. @mtkopone, would you mind taking a look at your last commit?

@mtkopone
Copy link
Contributor

Hi.
I'm having trouble reproducing this.

Assumed from res.json(...) that you're using express.

Wrote a test case in my fork for this, but it passes:
https://github.com/mtkopone/cookies/blob/fix-express-cookie-duplication/test/issue-20.js

One thing that might be relevant is the version of express you are using?

@jed
Copy link
Contributor

jed commented Nov 26, 2012

@think-free, let me know if the latest commit is now working for you, okay?

@jedrichards
Copy link

Hey ... I think I just had this issue too. Only the last cookie set was making it into the response headers. I'm using Restify not Express. Updating from 0.3.4 > 0.3.5 fixed it for me. Thx! ^^

@think-free
Copy link
Author

Hi !
Same here, using restify not express.
I don't have a lot of time to test the last commit. I'll try to test it tomorrow ...
I can try to make a snippet reproducing this bug if the last commit doesn't solve the problem.
I'll tell you tomorrow ;)
Thanks

@mtkopone
Copy link
Contributor

My bad. Didn't know people we using this with restify.

But should be fixed in 0.3.5.

Also, I wrote a test for restify, which is coming in a pull request.

@jed
Copy link
Contributor

jed commented Nov 27, 2012

the new restify tests from @mtkopone pass, so i'm going to assume this is fixed. let me know if you have any issues, @think-free.

@jed jed closed this as completed Nov 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants