martyjs / marty

A Javascript library for state management in React applications
http://martyjs.org
MIT License
1.09k stars 77 forks source link

Fix inconsistent fetch behavoir in Chrome #302

Closed nholland94 closed 9 years ago

nholland94 commented 9 years ago

I noticed an issue with Chrome 42+ where cookies would not be sent when using the request API provided by the http state source. After some investigation, I found out that Chrome's implementation of fetch does send any cookies by default (https://github.com/github/fetch/issues/121). So, in order to make Chrome's behavior consistent, the credentials options must be set to "same-origin".

Let me know if you think that this could cause some undesirable effects, but I think this change will only align the behaviors of the fetch polyfill and Chrome's native fetch.

jhollingworth commented 9 years ago

what version of marty are you using? Sometime in the past month or so we introduced a hook that does this for you which is included by default.

nholland94 commented 9 years ago

My bad. Looks like upgrading should fix it for us.