Why is jquery's .ajax() method not sending my session cookie?

后端 未结 11 1706
长情又很酷
长情又很酷 2020-11-22 02:25

After logging in via $.ajax() to a site, I am trying to send a second $.ajax() request to that site - but when I check the headers sent using FireB

11条回答
  •  面向向阳花
    2020-11-22 03:04

    After trying out the other solutions and still not getting it to work, I found out what the problem was in my case. I changed contentType from "application/json" to "text/plain".

    $.ajax(fullUrl, {
        type: "GET",
        contentType: "text/plain",
        xhrFields: {
             withCredentials: true
        },
        crossDomain: true
    });
    

提交回复
热议问题