Fetch-API not sending credentials when credentials are omitted

Issue #19851173 • Unassigned


Noobish N.
Dec 6, 2018
This issue is public.
Found in
  • Microsoft Edge
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
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 !

  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);


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 ?

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

    Sign in