fetch() always follows redirects but does not persist cookies

Requests via fetch() always follow redirects, regardless of the redirect property, but do not persist cookies.

This breaks any requests which use both cookies and redirects.

This could be fixed by either supporting the fetch api redirect property (in which case the user could specify manual, and pass the cookies across themselves for redirects), or by passing across the set-cookie header from the previous response when automatically following redirects.

Sadly XMLHttpRequest seems to suffer from exactly the same problem :confused:

We have planned an overhaul of the underlying http api, I’ll make sure to add this to the list.