C
C#9mo ago
ibby

SignInAsync Set-Cookie header not working?

Frontend: localhost:3000
Backend api: localhost:61927
Frontend: localhost:3000
Backend api: localhost:61927
Using fetch() to hit a sign in endpoint that calls HttpContext.SignInAsync, it adds the token to Set-Cookie header but the cookie never gets set on my frontend? I've already configured CORS and I'm getting no CORS errors. Not sure whats wrong
No description
4 Replies
Jimmacle
Jimmacle9mo ago
i ran into this recently, iirc it's a specific combination of browser, CORS, and localhost that prevents cross-origin cookie setting
Jimmacle
Jimmacle9mo ago
Medium
Cross-Site Cookies Will Now Be Rejected on localhost Because of Sam...
If you’re looking to building a project in which you would be serving cross-site cookies, here’s what you need to know.
ibby
ibbyOP9mo ago
I had to set credentials: "include" in the fetch call
Jimmacle
Jimmacle9mo ago
:PepeHmmm: i should try that on my end too

Did you find this page helpful?