title: Enabling browser cookies with Swagger-js
body: <p>I am using swagger-js/swagger-client (<a href="https://github.com/swagger-api/swagger-js" rel="nofollow noreferrer">https://github.com/swagger-api/swagger-js</a>) in an AngularJs SPA to send REST request to a nodeJS server using the TryItOut Executor.</p>
  
  <p>I am using PassportJS for authentication. When I use Angular's $http service with the withCredentials property set to true:</p>
  
  <pre><code>$http({
          method: 'GET',
          withCredentials: true,
          url: 'http://someUrl/someRestPath/' })
  </code></pre>
  
  <p>, everything works OK - browser cookies are properly set, and every further request is successfully authenticated.</p>
  
  <p>Switching to swagger-js Executor, I cannot get authenticated properly since cookies are not being set. I have tried the following:</p>
  
  <pre><code>var swaggerClient = new SwaggerClient(specUrl)
    .then(function (swaggerClient) {                                            
        swaggerClient.http.withCredentials = true; // this activates CORS, if necessary
  </code></pre>
  
  <p>as suggested in the documentation but this has no effect. Although I receive credentials when I authenticate with passport, further requests are unauthorized as cookies are not being set.</p>
  
  <p><a href="https://i.stack.imgur.com/3iFrl.png" rel="nofollow noreferrer">Left: cookies not being sent; Right: cookies being set</a></p>
  
  <p>How to enable this behavior using swagger-js?</p>