javascript

timeout javascript

A short technical note on Timeout Javascript, outlining the basic approach and actionable steps.

Those who want to put a timer on your page for time out can edit the code below.

var c = 0;
var maxC = 6000;
var waitingMaxC = 18000;
function timedCount() {
    c = c + 1;
    if (c == maxC) {
        if (confirm("Uzun süre işlem yapmadığınız için oturumunuz kapatılacaktır. <br/>Oturumu sürdürmek istiyormusunuz ?")) {
            c = 0;
        } else {
            location.href = "/";
        }
    }
    if (c == waitingMaxC) {
        location.href = "/";
    }
    t = setTimeout("timedCount()", 1000);
}