[whatwg/fetch] Fetch not sending cookies ? SameSite=none Secure credentials include cors (Issue #1354)

I hope i am doing only a mistake by using fetch.

Setup:
- Backend server reachable at: "https://backend.com/api"
- Browser has cookie for backend:
   - SameSite: None
   - Secure
   - Domain: backend.com
   - Path: /
   - And a value of course
- Webapp running at "http://127.0.0.1/login"

I now want to fetch something from the backend and want that the cookie will be also send.
In my tests the cookie was never send (Firefox, Chrome and Safari), so that I believe I made a config/code mistake.

Code:

```
try{
 let response = await fetch(url, {
  method: 'POST',
  credentials: 'include',,
  body: null,
  mode: "cors"
 })
 console.log(response);
} catch (err){
 console.log(err);
}
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1354

Received on Friday, 12 November 2021 10:47:36 UTC