stevenhello
Member
- Joined
- Jan 2, 2023
- Messages
- 5
- Programming Experience
- 1-3
Hi,
i have the Problem that i want to send after a successul Login on my net core Web API a httponly cookie to the Browser (to save a Refresh Token Authorisation).
But i can't see after the Login the cookie in the Browser (Development Tools - Application Data).
I am in development Mode:
API Controller: https://localhost:7137/api/Auth/Login
Client is an Angular App: https://localhost:4200/
That's the cookie options in the Login Controller:
i can see in the Developer Tools of the Browser on thte Network Tab the Cookie Header in the Login Response (Login is successful).
Also in Postman for testing i see the Cookie Header in the Api Response
But not in the Application Data of the Browser .
The Cookie is also not attached to further Requests to the API!
On the Login Request from the Angular Client i set the Header: withcredentials: true
Any Ideas?
Thank you!
Steven
i have the Problem that i want to send after a successul Login on my net core Web API a httponly cookie to the Browser (to save a Refresh Token Authorisation).
But i can't see after the Login the cookie in the Browser (Development Tools - Application Data).
I am in development Mode:
API Controller: https://localhost:7137/api/Auth/Login
Client is an Angular App: https://localhost:4200/
That's the cookie options in the Login Controller:
cookie options:
var cookie = new CookieOptions
{
HttpOnly = true,
Expires = DateTime.UtcNow.AddDays(10),
SameSite = SameSiteMode.None,
Secure = true,
Domain = "localhost"
};
HttpContext.Response.Cookies.Append("rToken", token, cookie);
i can see in the Developer Tools of the Browser on thte Network Tab the Cookie Header in the Login Response (Login is successful).
Also in Postman for testing i see the Cookie Header in the Api Response
But not in the Application Data of the Browser .
The Cookie is also not attached to further Requests to the API!
On the Login Request from the Angular Client i set the Header: withcredentials: true
Any Ideas?
Thank you!
Steven