title: "Refused to set unsafe header 'Cookie' " while sending cookies with GET request in angular 6
body: <p>I am using spring security with angular 6. When i login using basic Auth  server sends  a cookie <strong>JessionID</strong> with response. I want to send this cookie with other request for authentication purpose but it gives me error <code>Refused to set unsafe header 'Cookie'</code> . When i hit the same endpoint from postman with same cookie in header it works.</p>
  
  <p><strong>Below is the method in angular:</strong></p>
  
  <p><strong>Note</strong>: Currently i am manually adding it with headers.</p>
  
  <pre><code>private heroesUrl = 'http://localhost:8080/hi';
       header = new HttpHeaders().set("Cookie", "JSESSIONID=A2A75EC9A3E1172D60060C6E708549B5");
      getMessage() :Observable&lt;Message&gt;{
        return this.http.get&lt;Message&gt;(this.heroesUrl,{headers:this.header});
      }
  </code></pre>
  
  <p><strong>Response which i get when i login using basic Auth</strong></p>
  
  <p><a href="https://i.stack.imgur.com/vooyk.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vooyk.png" alt="Response which i get when i login using basic Auth"></a></p>