title: Cookies from php being received but not set in browser
body: <p>Got a simple Apache server running a php script</p>
  
  <pre><code>&lt;?php
  setcookie("TestCookie", 50, time()+10, "/", "http://localhost:80", false, false);
  echo json_encode("blah");
  ?&gt;
  </code></pre>
  
  <p>With a .htaccess file that looks like this</p>
  
  <pre><code>Header set Access-Control-Allow-Origin "http://localhost:4200"
  Header set Access-Control-Allow-Credentials "true"
  </code></pre>
  
  <p>And a http call in an Angular service that looks like this</p>
  
  <pre><code>test(): Observable&lt;JSON&gt; {
      return this.http.get&lt;JSON&gt;("http://localhost:80/project/testing.php", {withCredentials: true});
  }
  </code></pre>
  
  <p>The problem isn't that I'm not receiving the cookie, as I can see it when I click on the <code>Cookies</code> tab in the request to <code>testing.php</code>. The problem is that the browser isn't storing it. When I click on site settings to see the cookies in use, it's missing. And when I enter in <code>document.cookie</code> into the console, I get an empty string in return.</p>
  
  <p><a href="https://i.stack.imgur.com/6Zd59.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Zd59.jpg" alt="cookie"></a></p>
  
  <p><a href="https://i.stack.imgur.com/EjBwE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EjBwE.jpg" alt="site settings"></a></p>
  
  <p><a href="https://i.stack.imgur.com/luYAk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/luYAk.jpg" alt="console"></a></p>
  
  <p>Any ideas?</p>