C
C#3mo 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
Jimmacle3mo ago
i ran into this recently, iirc it's a specific combination of browser, CORS, and localhost that prevents cross-origin cookie setting
Jimmacle
Jimmacle3mo 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
ibby3mo ago
Phind came in clutch https://www.phind.com/search?cache=oh11nkp75o3qrvnnls9r9aht I had to set credentials: "include" in the fetch call I thought that was only for including a cookie for outbound requests
Jimmacle
Jimmacle3mo ago
:PepeHmmm: i should try that on my end too