0

In my Application ID I changed in security attributes -> Maximum Session Idle Time in Seconds as 900 seconds, but issue is if I am on same page number it gives me session timeout message.

I want session timeout on user's movement over the page or other tabs it should not be restricted because all my application work is in mostly one page.

enter image description here

chrisis
  • 1,983
  • 5
  • 20
  • 17
Anshul Ayushya
  • 131
  • 5
  • 21
  • Do mean that your applications work like single page applications? Does this mean that they send ajax requests to the server? Orr does this mean that the users are doing tasks that take a long time (filling long forms, playing games etc)? – Anuswadh Sep 16 '20 at 10:17
  • yeah filling long assignments its a big process running but not by submitting the page instead I did it via Dynamic Action. – Anshul Ayushya Sep 16 '20 at 11:32

1 Answers1

0

Session timeout is managed by the web application server and it needs a request or form submission to tell him, hey I'm alive, dude please don't kill the session, so for that reason you need to create an ajax request to tell web server you are still there.

You can use this script to detect user inactivity

var IDLE_TIMEOUT = 60; //seconds
var _idleSecondsCounter = 0;
document.onclick = function() {
    _idleSecondsCounter = 0;
};
document.onmousemove = function() {
    _idleSecondsCounter = 0;
};
document.onkeypress = function() {
    _idleSecondsCounter = 0;
};
window.setInterval(CheckIdleTime, 1000);

function CheckIdleTime() {
    _idleSecondsCounter++;
    var oPanel = document.getElementById("SecondsUntilExpire");
    if (oPanel)
        oPanel.innerHTML = (IDLE_TIMEOUT - _idleSecondsCounter) + "";
    if (_idleSecondsCounter >= IDLE_TIMEOUT) {
        alert("Time expired!");
        document.location.href = "logout.html";
    }
}

Check this post Detecting user inactivity over a browser - purely through javascript

Enrique Flores
  • 716
  • 4
  • 13