I have a common script included on every page, which initialize idletime variable to 0 as as soon as user logs in, and increment it after every 30 seconds, for which i have function written which is working fine, but after incrementing that variable i have to set that value to some session level variable so that on every page refresh this function increment should get that incremented value.Please find the code below
<script type="text/javascript">
var timeOut=600000;//This is timeout value in miliseconds
var idleTime = 0; // we shud get the incremented value on everypage refresh for this variable
$(document).ready(function () {
//Increment the idle time counter every minute.
var idleInterval = setInterval(timerIncrement, 30000); //30seconds
});
function timerIncrement() {
idleTime = idleTime + .5;//incrementing the counter by 30 seconds
var timeout= timeOut/60000;
if (idleTime > (timeout-2)) {
document.getElementById('logoutLink').click();
}
}
</script>