developit/redaxios

QUESTION: How does redaxios handle cookies?

tandrewnichols opened this issue ยท 5 comments

With axios you have to set withCredentials or cookies aren't sent to the server. Some things I've read suggest fetch requires just credentials. I don't see either of those things (or really much at all related to cookies) in the redaxios source code, and yet I'm seeing cookies sent with requests. Which is neat. But I want to make sure that keeps happening and/or understand what makes it happen. Thanks.

Edit: also maybe withCredentials should be supported if you're going for compatibility with axios.

Credentials are always sent when requests are same-origin - that should be the case in both libraries, since it is the same in Fetch and XHR. I'd forgotten to forward withCredentials to fetch, which is a bug - it should set credentials:'include' when true.

This seems easy, I can send a PR if it's ok.

@crissto Are you still working on this by any chance?

Sorry, I got sidetracked and forgot to push the PR.

Fix published in version 0.3.0.