03-15-2018 19:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

03-15-2018 19:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm trying to include cookies by including them in a fetch request, but they appear to be stripped by the time I receive them. Here's the code:
let authenticator="...";
fetch("https://speechcode.com/calendar/fitbit", { method: "GET", headers: { "alpha": "bravo", "Cookie": `user=${authenticator}`} })...
The "alpha" header, on the other hand, does reach the back end. And when browsers send the "Cookie" header, they are received.
Is something in fetch stripping the Cookie header? If so, what do I have to do to include a cookie in my request?
Thanks.
Answered! Go to the Best Answer.

Accepted Solutions
03-15-2018 22:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

03-15-2018 22:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I solved this problem by using a prior POST with authentication information to cause a cookie to be set, just as in a browser.

03-15-2018 22:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

03-15-2018 22:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I solved this problem by using a prior POST with authentication information to cause a cookie to be set, just as in a browser.

