Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery auto idle logout

// Set timeout variables.
var timoutWarning = 840000; // Display warning in 14 Mins.
var timoutNow = 900000; // Timeout in 15 mins.
var logoutUrl = 'http://domain.com/logout.aspx'; // URL to logout page.

var warningTimer;
var timeoutTimer;

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

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

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

// Logout the user.
function IdleTimeout() {
    window.location = logoutUrl;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: get data from mulitple query parameters react 
Javascript :: vue ignore not used error 
Javascript :: change candle color react highcharts 
Javascript :: array[-1] not working 
Javascript :: highcharts react hide data point dots 
Javascript :: calculations inside a render function react js 
Javascript :: javascript return opposite boolean 
Javascript :: Functions & Exec Context makePlans 
Javascript :: success and failure callback functions js 
Javascript :: 24 hour datepicker 
Javascript :: substraction js 
Javascript :: Send data (pass message) from a (non content script ) extension component to the content script 
Javascript :: document.elementsFromPoint 
Javascript :: javascript csv einlesen-jqueryAjax 
Javascript :: angular table lazy loading 
Javascript :: nice password generator 
Javascript :: rails + vue js projcet demo 
Javascript :: como acrescentar item no array js 
Javascript :: dynamic components 
Javascript :: hover not working on tailwind 
Javascript :: return a specific value filter javascript 
Javascript :: three movimiento js 
Javascript :: angular 2 on data bound event equivalent 
Javascript :: mongoose-unique-validator 
Javascript :: Audio Stream from Server through Scoket 
Javascript :: parsing error cannot find module 
Javascript :: getters and setters in java script 
Javascript :: js remove null object 
Javascript :: three.js first issue resolved awwwards merge webgl html worlds 
Javascript :: how to set a custom error message to a form in angular 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =