'Webhook' node and 'Respond to Webhook' node are omitting same-name headers

Describe the issue/error/question

When attempting to send multiple cookies, as a response to a webhook call, the cookie headers get omitted.

By definition (Set-Cookie - HTTP | MDN), to send multiple cookies as part of the response, the header ‘Set-Cookie’ needs to be sent multiple times.

But, in the current scenario, if we do that in the Respond to Webhook node, only one of the multiple Set-Cookie is sent and the rest get omitted.

Please share the workflow

Share the output returned by the last node

Response sent from n8n:

Received data on the client:

This issue extends to the Webhook node as well.

Data sent from the client:

Data received by the Webhook node.

As seen in the above image, the multiple cookies received have all been clubbed under one header, thus making it infeasible to retrieve each of the cookies individually.

Information on your n8n setup

  • n8n version: 0.219.1
  • Database you’re using (default: SQLite): Postgres
  • Running n8n with the execution process [own(default), main]: main
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

I suppose this might require some code modification in the Respond to Webhook node.

In the meanwhile, could there be a workaround that enables sending multiple cookies in the Response headers?

As a workaround I would probably do what the page you have linked to suggests and split your values with a ; that should then get you around it.

But separating using ; is mainly for separating the different attributes of an individual cookie.

e.g. in this:

it’s almost impossible to judge which ; to select as the demarcation between different cookies, as opposed to different attributes within an individual cookie.

Sadly this is the best I have available at the moment, It would be a case of splitting on the ; and working from there. This is one of those things where it will need to be prioritised to be implemented although I may have a quick look later in the week to see if it is a quick fix.

1 Like

I’ve created a fork that allows this, but please be warned I’m very inexperienced in TS, although I hope to get better so I can contribute more.
Please see the screenshots for the updated respond to webhook node.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.