Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer stop after Redir #36

Open
shashankkrjain opened this issue Mar 10, 2016 · 1 comment
Open

Timer stop after Redir #36

shashankkrjain opened this issue Mar 10, 2016 · 1 comment

Comments

@shashankkrjain
Copy link

The timer should stop after onRedir function has finished execution. Effectively when the whole sessionTimeout cycle has finished once.

The problem is, in our application, we show lock screen modal on the same page, and not redirect user to lock screen page. Now, what happens is, the timer keeps running and shows session timeout warning again.

@sandeepjadala
Copy link

Check if your lock screen modal exists in document then don't startSessionTimer in bootstrap-session-timer.js. Hope this helps you.

function startSessionTimer() {
//*******check if login dialog exists then don't reset timer****************
if ($('#loginModal').length == 0) {

            // Clear session timer
            clearTimeout(timer);
            if (opt.countdownMessage || opt.countdownBar) {
                startCountdownTimer('session', true);
            }

            if (typeof opt.onStart === 'function') {
                opt.onStart(opt);
            }

            // If keepAlive option is set to "true", ping the "keepAliveUrl" url
            if (opt.keepAlive) {
                keepAlive();
            }

            // Set session timer
            timer = setTimeout(function () {
                // Check for onWarn callback function and if there is none, launch dialog
                if (typeof opt.onWarn !== 'function') {
                    $('#session-timeout-dialog').modal('show');
                } else {
                    opt.onWarn(opt);
                }
                // Start dialog timer
                startDialogTimer();
            }, opt.warnAfter);

        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants