title: Cookie not being stored in browser after call with Axios
body: <p>I am playing with creating a simple authentication system and have a simple play project at: <a href="https://github.com/ericg-vue-questions/authentication" rel="nofollow noreferrer">https://github.com/ericg-vue-questions/authentication</a></p>
  
  <p>The main technologies I am using are:</p>
  
  <ol>
  <li><a href="https://github.com/tiangolo/fastapi" rel="nofollow noreferrer">FastAPI</a> for the backend server </li>
  <li><a href="https://vuejs.org" rel="nofollow noreferrer">Vue</a> for the frontend UI </li>
  <li><a href="https://github.com/axios/axios" rel="nofollow noreferrer">axios</a> to communicate from the frontend to the backend (eventually, a standard OpenAPI client)</li>
  </ol>
  
  <p>I am make the axios call by <a href="https://github.com/ericg-vue-questions/authentication/blob/master/frontend/src/components/Login.vue" rel="nofollow noreferrer">doing</a>:</p>
  
  <pre><code>axios
    .get('http://127.0.0.1:8000/api/login', {
      params: {
        username: username,
        password: password
      },
      withCredentials: true
    })
    .then((response) =&gt; {
      console.log('Logged in')
      console.log(response)
    })
    .catch(err =&gt; { console.log(err) })
  </code></pre>
  
  <p>On the backend, the <a href="https://github.com/ericg-vue-questions/authentication/blob/master/backend/main.py" rel="nofollow noreferrer">code</a> that sets the cookie is:</p>
  
  <pre><code>@app.get("/api/login", tags=["api"], operation_id = "login" )
  async def login( username: str, password: str, response: Response ):
  
      authenticated = False
  
      if username in users:
          if users[ username ][ 'password' ] == password:
              authenticated = True
              response.set_cookie( key="user", value=str( users[ username ][ 'id' ] ), max_age = 60 * 60 * 24 )
  
      return authenticated
  </code></pre>
  
  <p>I can confirm that the cookie is being sent and received in the browser, but it is not being stored for some reason. I thought that the only thing that was required was to set withCredentials: true in the axios get request, but that doesn't seem to be working. Any idea what I might be doing wrong?</p>
  
  <p>My Response headers are:</p>
  
  <pre><code>HTTP/1.1 200 OK
  date: Sun, 15 Dec 2019 01:54:14 GMT
  server: uvicorn
  content-length: 4
  content-type: application/json
  set-cookie: user=userid; Max-Age=86400; Path=/
  access-control-allow-credentials: true
  access-control-allow-origin: http://localhost:8080
  vary: Origin
  </code></pre>