can't set a cookie in my browser
this is not what I intended to do, I want to work with sessions and passportjs. but it turns out that the
express-session
can't set a cookie to my browser. that's why I tried this:
but still doesn't work
I get this header in my response:
Set-Cookie: cookie=7400542671495325; Max-Age=900; Path=/; Expires=Sat, 24 Sep 2022 13:32:53 GMT
but that cookie is not set in my browser1 Reply
oh I got it fixed, it not obvious at all from a web dev perspective. I hate this.
but here is the solution if someone has the same the problem:
it depends on the tools you use to communicated between front and back, but here is mine.
also, I just found this on MDN
Unless fetch() is called with the credentials option set to include, fetch(): won't send cookies in cross-origin requests won't set any cookies sent back in cross-origin responsesnobody mentions this in articles and youtube videos.