private void ParseCookies(WebSocketHandshake handshake)
 {
     if (handshake.Request.Headers.HeaderNames.Contains(WebSocketHeaders.Cookie))
     {
         var cookieString = handshake.Request.Headers[WebSocketHeaders.Cookie];
         try
         {
             foreach (var cookie in CookieParser.Parse(cookieString))
             {
                 cookie.Domain = handshake.Request.Headers.Host;
                 cookie.Path   = String.Empty;
                 handshake.Request.Cookies.Add(cookie);
             }
         }
         catch (Exception ex)
         {
             throw new WebSocketException("Cannot parse cookie string: '" + (cookieString ?? "") + "' because: " + ex.Message);
         }
     }
 }