0

I am not getting Set-Cookie value from response header. Value throw null

enter image description here

my code below

$.ajax({
    url: ip_add + '/' + reqUrl,
    crossDomain: true,
    type: "POST",
    dataType: "json",
    data: req_data,
    xhrFields: {
        withCredentials: true
    },
    beforeSend: function(xhr) {
        xhr.setRequestHeader("X-CSRFToken", csrftoken);
    },

    success: function (res, textStatus, XMLHttpRequest) {      
        var cookietoSet = XMLHttpRequest.getResponseHeader('Set-Cookie');
        alert(cookietoSet);
    },
    cache: false, 
});
Barmar
  • 741,623
  • 53
  • 500
  • 612
Prasanth
  • 11
  • 1

0 Answers0