title: webpack-dev-server set cookie via proxy
body: <p>We have setup our development environment with webpack-dev-server. We use its proxy config to communicate with the backend. </p>
  
  <p>We have a common login page in the server which we use in all our applications. We it is called, it sets a session cookie which expected to passed with subsequent requests. We have used the following config but the cookie is not set in the browser for some reason. I can see it in response header in the network tab of dev tool. </p>
  
  <pre><code>const config = {
    devServer: {
       index: "/",
       proxy: {
       "/rest_end_point/page": {
             target: "https://middleware_server",
             secure : false
       },         
       "/": {
             target: "https://middleware_server/app/login",
             secure : false
      },        
  }
  </code></pre>
  
  <p>The <em><a href="https://middleware_server/app/login" rel="noreferrer">https://middleware_server/app/login</a></em> endpoint returns the login page with the set-cookie header.</p>
  
  <p>The proxy is used to avoid CORS errors when accessing login pages and API calls.</p>
  
  <p>Upto this point no code from the application is executed. Do we have to do something in the coomon login page to get the cookie set?</p>
  
  <p>the application is written with React. </p>
  
  <p>Any help would be appreciated.  </p>