title: Angular 8 get "Set-Cookie" header from HttpResponse
body: <p>I have the following Java Spring REST API method:</p>
  
  <pre><code>@RequestMapping(value = "/login", method = RequestMethod.POST)
  public ResponseEntity login(@RequestBody LoginRequest request) {
      request.getSession(true);
      LoginResponse res = this.authService.login(request);
      return new ResponseEntity&lt;&gt;(res, HttpStatus.OK);
  }
  </code></pre>
  
  <p>When called using Postman or from a FireFox browser, I can clearly see the "Set-Cookie" header:</p>
  
  <p><a href="https://i.stack.imgur.com/1XOM9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1XOM9.png" alt="enter image description here"></a></p>
  
  <p>Yet, when I'm using <code>console.log</code> to print the response in Angular, I don't see this header:</p>
  
  <p><a href="https://i.stack.imgur.com/y2FuK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y2FuK.png" alt="enter image description here"></a></p>
  
  <p>This is the REST call in Angular:</p>
  
  <pre><code>this.http.post&lt;Login&gt;(this.url, this.loginRequest, {
    headers: AuthService.getHeaders(),
    observe: 'response',
    withCredentials: true
  }).subscribe(
    response =&gt; {
      console.log(response);
  });
  </code></pre>
  
  <p>I did add <code>withCredentials: true</code> and <code>observe: 'response'</code> to the request call as suggested, and I do get the whole response, but without the cookie.
  What I want to do is to get a cookie after a successful login, which will be delivered with any request afterwards for authentication in the server.</p>
  
  <p>Thanks for the help!</p>