title: Javascript websocket client adding cookie to header
body: <p>I am creating a websocket upgrade request in javascript and need to add a cookie for adding an authentication token, is this possible with cross domain restrictions?  My implementation is pretty basic:</p>
  
  <pre><code>document.cookie="token="+authToken+";domain=www.test.com;path=/";
  websocket = new WebSocket(endpoint);
  </code></pre>