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.
Best AnswerI solved this problem by using a prior POST with authentication information to cause a cookie to be set, just as in a browser.
Best Answer