Skip to content
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

XMLHttpRequest.withCredentials "always" set to true #495

Closed
KeremTubluk opened this issue Oct 1, 2016 · 6 comments · Fixed by #614
Closed

XMLHttpRequest.withCredentials "always" set to true #495

KeremTubluk opened this issue Oct 1, 2016 · 6 comments · Fixed by #614

Comments

@KeremTubluk
Copy link

There seems to be a problem with the xhr polling as it sets withCredentials to true if withCredentials exits in xhr (This always happens?).

As the engine.io-server does not depend on the extra information granted by withCredentials (Cookies e.g.), should not this be set to false by default? And/or should there be a configuration for it?

Line 226-229 in polling-xhr.js
// ie6 check
if ('withCredentials' in xhr) {
  xhr.withCredentials = true;
}
@mohitncode
Copy link

Hi Kerem,

From the MDN XMLHttpRequest.withCredentials page:

The XMLHttpRequest.withCredentials property is a Boolean that indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. Setting withCredentials has no effect on same-site requests.

Since this flag is necessary for cross-domain XHR requests and doesn't make a difference for same domain requests, I guess it is left as true by default.

@darrachequesne
Copy link
Member

Closed due to inactivity, please reopen if needed.

@ipeychev
Copy link

We have the same problem and we would like to reopen this issue.

The user should be able to configurewithCredentials. We want to be able to set it to false to handle sub-domains of public suffixes domains. Moreover, false is the default value.

Our suggestion is to make withCredentials configurable.

@ValorLin
Copy link

ValorLin commented Aug 1, 2018

image
It should defaults to be false, and it should be configurable.

@ghost
Copy link

ghost commented Dec 6, 2018

We are having same problem and want withCredentials to be false. Is there any workaround available for this?

@DuBistKomisch
Copy link
Contributor

I don't have permission to reopen this issue but I've submitted a PR adding an option for this: #614

darrachequesne pushed a commit that referenced this issue Sep 13, 2019
withCredentials was always set to true, despite the browser default being false, and can now be overridden.

Closes #495
enderson-pan pushed a commit to holytiny/feathersjs-wxmp-socket.io-client that referenced this issue Nov 1, 2019
withCredentials was always set to true, despite the browser default being false, and can now be overridden.

Closes socketio/engine.io-client#495
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants