title: Set cookie from SignalR hub on the server
body: <p>Is there anyway I can set a cookie from inside a SignalR hub, specifically the <code>OnConnected</code> method. I want to send a cookie with a session id.</p>
  
  <p>I tried this but it didn't seem to work, it also looks awkward because I'm not sure why I need to provide a key value pair of a string and a cookie.</p>
  
  <pre><code>public override Task OnConnected()
  {
      var guid = new Guid();
      Context.RequestCookies.Add("SessionID", new Microsoft.AspNet.SignalR.Cookie("SessionID", guid.ToString()));
      return null;
  }
  </code></pre>