Login page redirection

In MVC, I made an Employee Profile. On a particular screen, I have 8 tabs. Everything is working fine. I need if the session ends, the page should be redirected to the login page. How to write jQuery for this.

+3
source share
3 answers
var sessionTimeout = 30 * 60; //30 minutes
function toLoginPage() {
   window.location = '/login';
}
setTimeout(toLoginPage, sessionTimeout);

or

var sessionTimeout = 30 * 60; //30 minutes
setTimeout(function () {
    window.location = '/login';
}, sessionTimeout);
+1
source

Perhaps you can adapt the logout function in your account controller to redirect to the login page.

0
source

Source: https://habr.com/ru/post/1779535/


All Articles