-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser cookies not sent by default, no easy way to change #203
Comments
We've introduced the concept of "hooks" in v0.9 which allows you to modify requests before they are sent and responses after received. Do you think they could be used to fix this case? |
Yes, hooks look like they would allow me to globally change the behavior for my application. Still might be nice to change the default marty behavior to send browser cookies on requests, though. |
I'd like to avoid changing the existing behaviour if possible. If we're quietly modifying the expected behaviour of fetch this could confuse some people. If this becomes a recurring request then I will reconsider Thanks! |
I'm going to back track on my previous comment. #209 adds an http hook which sets |
Great! Thanks! |
When using jQuery's ajax methods, the browser's cookies are sent along with each same-origin request. If your user is currently logged in, then their requests are logged in too.
The fetch spec however requires that no cookies be sent unless the
credentials
option is explicitly set to 'same-origin' or the stronger 'include'. (see here: https://github.com/github/fetch/pull/69/files?diff=split )There's currently no way to set the global fetch options for a new HttpStateSource, other than on each request you make.
I wonder if we should make HttpStateSource default to using credentials 'same-origin', and allow changing the default request options from HttpStateSource's mixinOptions.
The text was updated successfully, but these errors were encountered: