My MVC Application gets timeout after 20min. ie, When I click any buttons after 20mins automatically the application will get redirected to login page. All the buttons in my page uses Ajax call, hence when we click on any button the ajax will return failure code and redirected to login page.
Problem: If I am in the middle of a page with some search criteria and paging, when I login again after timeout I am not able to come to the exact page where I was before timeout. As I am using Ajax calls on button clicks I am not able to see the search parameters or page numbers on Url. Please can someone help on this.
On Timeout Ajax is returning the below error status and redirected to login page.
error: function (xhr, ajaxOptions, thrownError) {
if (xhr.status == 401) {
window.location.href = "/Home/Logout";
return;
}
}