admin管理员组

文章数量:1287791

I have an ASP.NET Web API and a react frontend, I hosted the backend on smarter asp and since I hosted, when I try to sign in using the frontend app, it fails to set the cookie in the browser, but I get success message saying I signed in.

  • note that the server is using https and free ssl in smarter asp
  • I used https aswell in the react app using mkcert
  • I am using axios with use-credentials set to true
  • issue only with the deployed API (works just fine locally)

This is the code to set the cookie :

  private void SetAccessTokenInResponse(string accessToken)
    {
        Response.Cookies.Append(AccessTokenName, accessToken, new CookieOptions
        {
            HttpOnly = false,
            Secure = true,
            SameSite = SameSiteMode.None,
            Expires = DateTime.Now.AddMinutes(15)
        });
    }

enter image description here

I am not sure whats causing this , so please help

本文标签: cCookies not being set in client browser from an ASPNET Web APIStack Overflow