# Websocket & cookie

**URL:** <https://discourse.nodered.org/t/websocket-cookie/5422>\
**Category:** Feature Requests\
**Created:** [2 December 2018 22:29 UTC](https://discourse.nodered.org/t/websocket-cookie/5422 "2018-12-02T22:29:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![indyspike](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/indyspike/32/4536_2.png) [@indyspike](https://discourse.nodered.org/u/indyspike)\
**Post date:** [2 December 2018 22:29 UTC](https://discourse.nodered.org/t/websocket-cookie/5422/1 "2018-12-02T22:29:55Z")

</div>

I'm trying to connect to a websocket that requires a session cookie in the header for authentication. Is this on the roadmap for the core websocket, worthy of a feature request in github, or a custom node I have to write based on the core code?

Thanks

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [2 December 2018 22:55 UTC](https://discourse.nodered.org/t/websocket-cookie/5422/2 "2018-12-02T22:55:16Z")

</div>

Hi - this is not something on the roadmap as this is the first time it has been requested. Happy to entertain a discussion on how such an option could be exposed on the node. It is unlikely to be a feature we'd drop everything to do right now - but with the right design in place, we'd then happily review a pull-request.

---

<div class="post-metadata">

**Author:** ![indyspike](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/indyspike/32/4536_2.png) [@indyspike](https://discourse.nodered.org/u/indyspike)\
**Post date:** [2 December 2018 23:17 UTC](https://discourse.nodered.org/t/websocket-cookie/5422/3 "2018-12-02T23:17:30Z")

</div>

Something I can't do right now either - the websocket is wss, and my environment is the homeassistant node-red addon with version 8.x of node.js. This combination gives me EPROTO errors until they update to node.js 10.x.

Will have to spin up a node-red dev environment so I can do some work on it.

Thanks for replying and letting me know the situation.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [3 December 2018 00:15 UTC](https://discourse.nodered.org/t/websocket-cookie/5422/4 "2018-12-03T00:15:36Z")

</div>

You might have a look at uibuilder. I tried to add some of this there but it has never really been tested.

---

<div class="post-metadata">

**Author:** ![crxporter](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/crxporter/32/25734_2.png) [@crxporter](https://discourse.nodered.org/u/crxporter)\
**Post date:** [17 August 2020 04:18 UTC](https://discourse.nodered.org/t/websocket-cookie/5422/5 "2020-08-17T04:18:39Z")

</div>

@knolleary (and all) It's been a while now And we’ve had some big nodered updates. I'm working on a websocket connection that requires a cookie for authentication as described here.

Can anyone comment whether this is possible now or recommend a node which will help accomplish this? If it's possible, some docs on how to send a cookie to websocket connection would be most appreciated.

---

<div class="post-metadata">

**Author:** ![sniicker](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sniicker/32/56525_2.png) [@sniicker](https://discourse.nodered.org/u/sniicker)\
**Post date:** [21 March 2022 14:51 UTC](https://discourse.nodered.org/t/websocket-cookie/5422/6 "2022-03-21T14:51:12Z")

</div>

I'm struggling hard on the same thing. Can anyone give some advice how to do this? Working for hours now and cannot find a solution...
