briefy / notes

notes to problems encountered
1 stars 0 forks source link

withCredentials #2

Open briefy opened 7 years ago

briefy commented 7 years ago

During http requests, especially if CORS needs, withCredentials is sometimes required.

WHEN do we need withCredentials ?

  1. when we make cross-site Access-Control requiests,cookies ,authorization headers or TLS client certificates are needed to be sent
  2. this flag is used to indicate when cookies are to be ignored in the response,However,keep in mind Third-party cookies obtained by setting withCredentials to be true will still honor the same-origin policy,CAN NOT be accessed by document.cookie or from response headers
  3. This never affects same-site requests

reference link--https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials