Fetch-API not sending credentials when credentials are omitted

Not reproducible Issue #19851173

Details

Author
Noobish N.
Created
Dec 6, 2018
Privacy
This issue is public.
Found in
  • Microsoft Edge
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Fetch returns incorrect results if credentials: ‘same-origin’ is omitted.
But the doc at
https://github.com/github/fetch#sending-cookies
states that the default is "same-origin".

So all fetch requests that go to SQL and require a user that is sent along in the cookie return either an error, or an empty array in Edge, while it works flawlessly in Chrome and Firefox and IE11 with Fetch-polyfill

note: to get the default-behaviour, comment out “credentials” in options !
Edge/17.17134

  let options: any = {
        "method": "POST",
        // "headers": { 'auth': '1234','content-type': 'application/json'},
        // https://stackoverflow.com/questions/38156239/how-to-set-the-content-type-of-request-header-when-using-fetch-api
        // "headers": new Headers({ 'content-type': 'application/json' })
        // "headers": { "Content-Type": "application/json" } 
        // "headers": new Headers({ 'Content-Type': 'application/json' }) 
        // "headers": { 'Accept': 'application/json', 'Content-Type': 'application/json' },
        // "headers": new Headers({ 'Accept': 'application/json', 'Content-Type': 'application/json' }), 
        "headers": myHeaders
        // ,"mode": "no-cors" 
        , credentials: 'same-origin' 
        , "body": <any>null
    };

fetch("ajaxData.ashx", options);

Attachments

0 attachments

    Comments and activity

    • let myHeaders = new Headers();
      myHeaders.append("Accept", “application/json”);
      myHeaders.append("Content-Type", “application/json”);

      Why can I not edit an issue, if I am the creator, at least within an hour of creating the issue ?

    • Microsoft Edge Team

      Changed Assigned To to “Zachariah L.”

    • Hi Noobish!

      Thank you for reaching out to us regarding this issue! Fetch-polyfill is not supported by the browser because Edge runs a native implementation of the Fetch standard. https://github.com/github/fetch#browser-support

      Please visit the official Fetch standard documentation for more information: https://fetch.spec.whatwg.org/

    • Microsoft Edge Team

      Changed Status to “Not reproducible”

    • At this time I will close out this issue. If you are still able to reproduce this issue then please provide the details I requested and I will resume investigating this issue.

      Best regards,​​​
      The Microsoft Edge Team. ​​

    You need to sign in to your Microsoft account to add a comment.

    Sign in