Hi team,
we are using angular JS and .net core API for our app development but now I need to identify in-active or idle timeout of the application.
Is there any way to track this ?
Thanks
Madan S B
Hi team,
we are using angular JS and .net core API for our app development but now I need to identify in-active or idle timeout of the application.
Is there any way to track this ?
Thanks
Madan S B
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajkiran SwainPosted Mar 29, 2023, 8:08 PM
var inactivityTime = function () {
var idleTime = 0;
var idleInterval = setInterval(timerIncrement, 60000); // 1 minute
function timerIncrement() {
idleTime++;
if (idleTime > 29) { // 30 minutes
clearInterval(idleInterval);
// Call your logout function here
}
}
// Bind events to reset idle time on user activity
angular.element(document).on('keydown click mousemove', function () {
idleTime = 0;
});
};