express icon indicating copy to clipboard operation
express copied to clipboard

Setting multiple cookies won't work (sometimes)

Open sylvio opened this issue 8 years ago • 8 comments

I am seeing the same issue described here: http://www.connecto.io/blog/nodejs-express-how-to-set-multiple-cookies-in-the-same-response-object/

Has anybody noticed this? It's been around for a while now.

sylvio avatar Jan 02 '18 22:01 sylvio

Yea, that issue was fixed a few years ago. We can certainly take a look to see if there is a new issue if you can provide us all the following so we can diagnose the issue:

  1. Version of Node.js
  2. Version of this module
  3. Complete source code that replicates the issue
  4. Browser and version that is having the issue
  5. Instructions to get everything setup and how to see the issue happening.

Thanks!

dougwilson avatar Jan 02 '18 22:01 dougwilson

Thanks for the quick response. I created a fairly simple module that interacts with Okta for authentication, this module is internal to Oath and has not been open sourced (yet). I cannot reproduce the problem in my own test environment but I have to internal customers who have witnessed this.

  1. Node version 8.9.3
  2. Express 4.16.2
  3. Not able to share as it is not my own code
  4. I've seen in both Chrome (63.0.3239.84) and Safari (11.0.2)
  5. Again not able to.

I realize that this will make it difficult/impossible to debug but I was curious if other people had seen it.

sylvio avatar Jan 02 '18 23:01 sylvio

Thanks @sylvio . I followed the code in the blog post and confirmed that the exact issue it described is indeed fixed. I'm not able to reproduce, and I know we fixed the exact issue in the blog post. I'm not really sure what I can do without being able to reproduce. Can you provide me what the next steps to resolution would be here?

dougwilson avatar Jan 02 '18 23:01 dougwilson

As for your question, no one has reported anything since the fix 3 years ago; you're the first one to report something like this to us. And I definitely don't want there to be a problem and am 100% willing to debug through it to fix, but I have no idea what the issue would be.... :( Have you attached a debugger to the code to see what is causing the duplicate header?

dougwilson avatar Jan 02 '18 23:01 dougwilson

I will ask the developer who complained about this for more details. I will keep you posted.

sylvio avatar Jan 02 '18 23:01 sylvio

Closing this. It turns out even though the app was including the latest version of express the framework running the code uses a much older version of express that cannot be changed. Sorry for the confusion.

sylvio avatar Jan 02 '18 23:01 sylvio

Hi @sylvio sorry for any confusion you had :( I was going to follow up on your previous comment to double-check the version just in case because it definitely was a bug years ago. It sounds like you're saying this was indeed the issue 👍 I don't really have a good suggestion besides seeing if you can force-upgrade that dependency. I believe there are some tools that can do this by npm hooks.

dougwilson avatar Jan 03 '18 00:01 dougwilson

We are in the process of moving to a more flexible framework where this won't be a problem anymore. Thanks for the suggestion though; for now I will mimic the fix in my module, it seems like the safer solution.

sylvio avatar Jan 03 '18 01:01 sylvio