session on Mouse over

Questionssession on Mouse over
germanmary asked 7 years ago

hi sir,

Session is not working in grid while trying to use my own session function.

For Example

<script>
var timoutWarning = 84000; // Display warning in 14 Mins.
var timoutNow = 84000; // Timeout in 15 mins.
//var timoutWarning = 30000; // Display warning in 14 Mins.
//var timoutNow = 31000; // Timeout in 15 mins.
var logoutUrl = 'logout.php'; // URL to logout page.

var warningTimer;
var timeoutTimer;

// Start timers.
function StartTimers() {
warningTimer = setTimeout("IdleWarning()", timoutWarning);
timeoutTimer = setTimeout("IdleTimeout()", timoutNow);
//alert(warningTimer);
//alert(timeoutTimer);
}

// Reset timers.
function ResetTimers() {
clearTimeout(warningTimer);
clearTimeout(timeoutTimer);
StartTimers();
$("#timeout").dialog('close');
//alert(warningTimer);
//alert(timeoutTimer);
}

// Show idle timeout warning dialog.
function IdleWarning() {
$("#timeout").dialog({
modal: true
});
}

// Logout the user.
function IdleTimeout() {
window.top.location.href = logoutUrl;
}
</script>

<body onload="StartTimers();" onmousemove="ResetTimers();" onchange="ResetTimers();" onInput="ResetTimers();">

Thank you

1 Answers
Abu Ghufran answered 7 years ago

I tested your code and is working as expected.
https://gist.github.com/gridphp/f18b8aed638796ba2916729dd283269f

I updated warning time to 10s and logout time to 20s for testing purpose.

Your Answer

18 + 18 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?