I need to make a request using fetch() to a page that sets cookies and then redirects you to another page.
The problem is that the cookies set on the first page don’t persist to the redirect page. I can’t disable the redirect to get the cookies myself
as redirect: ‘manual’ from the fetch API doesn’t do anything
The full documentation for fetch can be found here.
I did some quick googling, and some guy in this thread has a possible solution for your issue. Last, you could also manually extract the cookie from the response object, and send it as a header in a new fetch call, there seems to be tonnes of options.
The problem is I cannot get the response object where the cookie is set because fetch will automatically follow the redirect. The fetch documentation says you can use redirect:‘manual’ to stop this automatic redirect but it does not work in Fuse (It works in chrome devtools)
Request to page. Response is 301 with the Set-Cookie header set (I need the value of this).