title: CORS set-cookie header present in response but cookie isn't created
body: <p>I am trying to create a cookie in my client (127.0.0.1:3000)  from an API made in Go (127.0.0.1:8080), I think I've added most headers in the response needed for CORS and the cookie has <strong>samesite=none</strong> and <strong>secure=true</strong> but it is still not being set. Below I've added a picture of the request and response as shown in the chrome devtools network tab and also code of axios where the request is made and code of go where the request is handled in the API server.</p>
  <p><strong>GO:</strong></p>
  <pre><code>//Handles account sign ins
  func Login(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
      fmt.Println(&quot;login handler&quot;)
      //decoder := json.NewDecoder(r.Body)
      //var t models.LoginUserData
      //err := decoder.Decode(&amp;t)
      //if err != nil {
      //  log.Println(err)
      //}
      //middleware.SignIn(t.User.Username, t.User.Password)
  
      http.SetCookie(w, &amp;http.Cookie{Name: &quot;sabor&quot;, Value: &quot;merda&quot;, Path: &quot;/&quot;, HttpOnly: false, SameSite: http.SameSiteNoneMode, Secure: true, Domain: &quot;127.0.0.1&quot;})
      header := w.Header()
      header.Set(&quot;Access-Control-Allow-Credentials&quot;, &quot;true&quot;)
  
      //header.Set(&quot;Access-Control-Expose-Headers&quot;, &quot;Set-Cookie&quot;)
      header.Set(&quot;Access-Control-Allow-Headers&quot;, &quot;Content-Type, withCredentials&quot;)
      header.Set(&quot;Access-Control-Allow-Origin&quot;, &quot;http://127.0.0.1:3000&quot;)
      header.Set(&quot;Access-Control-Allow-Methods&quot;, &quot;POST, GET, OPTIONS&quot;)
      w.WriteHeader(http.StatusOK)
  }
  </code></pre>
  <p><strong>Axios:</strong></p>
  <pre><code>let config = {
        headers: {
          withCredentials: true,
        },
      };
  
  axios
        .post(
          &quot;http://127.0.0.1:8080/login&quot;,
  
          {
            User: {
              Username: username,
              Password: password,
            },
          },
  
          config
        )
        .then(function (response) {
          console.log(response)
          console.log(response.data)
          console.log(response.headers)
          console.log(response.data.cookie)
          if (response.status === 200) {
            console.log(&quot;if works&quot;)
            
          }
        })
        .catch(function (error) {
          console.log(error);
        });
  </code></pre>
  <p><strong>Request and Response image:</strong>
  <a href="https://i.stack.imgur.com/HGDmB.png" rel="nofollow noreferrer">Request and response image</a></p>