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

后端 未结 11 1548
长情又很酷
长情又很酷 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 02:58

    Put this in your init function:

    $.ajaxSetup({
      xhrFields: {
        withCredentials: true
      }
    });
    

    It will work.

提交回复
热议问题