title: How to set cookie in request header for websocket in Javascript?
body: <p>I'm using Angular2 and my backend authenticate the websocket request using Cookie in the request header. 
  I have created a cookie but it does not appear in the header of the websocket request.</p>
  
  <p>Here it is an example of what I will need to have. </p>
  
  <p><a href="https://i.stack.imgur.com/V1z0n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V1z0n.png" alt="enter image description here"></a></p>
  
  <p>For now I do not see the cookie while it is set.</p>
  
  <p><a href="https://i.stack.imgur.com/xx45t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xx45t.png" alt="enter image description here"></a></p>
  
  <p>I used this example to create the angular2 service : <a href="https://tutorialedge.net/angular-2-websockets-tutorial" rel="nofollow noreferrer">https://tutorialedge.net/angular-2-websockets-tutorial</a></p>
  
  <p>Thanks!</p>