hi, I have two MVC applications. I go to the MVC2 application from MVC1 application, I pass a token. When the MVC2 applications is loaded, its fetch the token and create the session. There are two button Logout and Save. I open MVC2 application in a IE browser and open the same application on the another tab. I just click the Logout button, which deletes all the sessions of the MVC2 application. Then I go to the first tab and click on the save button. Before saving the data, I simply check whether the session is exist or not, If session is exist then it will save the data otherwise redirect to the MVC1 application. But when I click on the Save button its shows the error "This page is accessing information that is not under its control. This proses a security risk. Do you want to continue?"
I have used following code to check the session in the save button
btnSave.bind("click", function(event) {
isSessionActive();
SaveData()
}
function isSessionActive() {
$.ajax({
url: "http://localhost/Home/IsSessionActive",
type: "POST",
data: {},
success: function(result) {
if (result !== "True") {
window.location = "http://MVC1/Home";
}
}
});
}
hi, I have two MVC applications. I go to the MVC2 application from MVC1 application, I pass a token. When the MVC2 applications is loaded, its fetch the token and create the session. There are two button Logout and Save. I open MVC2 application in a IE browser and open the same application on the another tab. I just click the Logout button, which deletes all the sessions of the MVC2 application. Then I go to the first tab and click on the save button. Before saving the data, I simply check whether the session is exist or not, If session is exist then it will save the data otherwise redirect to the MVC1 application. But when I click on the Save button its shows the error "This page is accessing information that is not under its control. This proses a security risk. Do you want to continue?"
I have used following code to check the session in the save button
btnSave.bind("click", function(event) {
isSessionActive();
SaveData()
}
function isSessionActive() { $.ajax({ url: "http://localhost/Home/IsSessionActive", type: "POST", data: {}, success: function(result) { if (result !== "True") {
window.location = "http://MVC1/Home";
}
}
});
}
The server side code of IsSessionActive is
public bool IsSessionActive()
{
if (Session == null || Session["AuthorizedToken"] == null)
{
return false;
}
return true;
}
I have also put the debugger point in the IsSessionActive function, but after logout it does not debug. It show the same message. Does anyone have any idea, how to resolve this problem.