I am using asp.net mvc4 application.Here i am using the form authentication.My scenario is like this, after authentication the auth token is not passing in the request header when i am using IE.But it is working fine with chrome and Mozilla .Here my authentication is done in first method and the second method i am calling is an ajax call.Is their any problem with ajax call?
First authenticating method is getjson method.Then i am using an ajax call.
if (user != "" && passwd != "" && location != "" && location != -1) {
$.getJSON(window.contexthttproot + "/Account/Location", { 'Username': user, 'Password': passwd }, function (items) {
if (items.length > 0) {
$('#Serverow').hide();
$('#locate').show();
$('#location').show();
$("#Username").attr("disabled", "disabled");
$("#Password").attr("disabled", "disabled");
$("#Location").fillSelect($.map(items, function (item) {
return {
ID: item.LocationID,
Name: item.LocationName
};
}));
setTimeout(function () {
$('#spinner').fadeOut('fast');
})
}
else {
setTimeout(function () {
$('#spinner').fadeOut('fast');
})
}
});
}
}
if (user != "" && passwd != "" && location != "" && location != -1) {
var json = "{'location':'" + location + "','locationName':'" + loctext + "'}";
$.ajax({
url: window.contexthttproot + "/Report/ReportLocation",
type: 'POST',
datatype: "json",
contentType: "application/json; charset=utf-8",
cache: false,
data: json,
success: function (items) {
window.location.replace("/LandingPage/Landing");
setTimeout(function () {
$('#spinner').fadeOut(35000);
})
},
error: function (xhr, status) {
}
});
}