Skip to content
Permalink
Browse files

Update session-timeout.js to enable refreshOnClick

Set default refreshLimit setting to 2 minutes as indicated in the documentation.
Update click event code in initRefreshOnClick to move the update of lastActivity time stamp into the code block that activates the reset and keepalive events.  This allows the refreshLimit threshold to be reached to trigger these events.
  • Loading branch information...
sgdowney committed Aug 26, 2015
1 parent fe17a48 commit 1e839a1e3035d46b27bff52944d0c1d87401c9bf
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/plugins/session-timeout/session-timeout.js
@@ -36,7 +36,7 @@ var $modal, $modalLink, countdownInterval, i18n, i18nText,
refreshCallbackUrl: null, /* refresh callback if using AJAX keepalive (no default) */
logouturl: "./", /* logout URL once the session has expired */
refreshOnClick: true, /* refresh session if user clicks on the page */
refreshLimit: 200000, /* default period of 2 minutes (ajax calls happen only once during this period) */
refreshLimit: 120000, /* default period of 2 minutes (ajax calls happen only once during this period) */
method: "POST", /* the request method to use */
additionalData: null, /* additional data to send with the request */
refreshCallback: function( response ) { /* callback function used to check the server response */
@@ -180,8 +180,8 @@ var $modal, $modalLink, countdownInterval, i18n, i18nText,
$elm
.trigger( resetEvent, settings )
.trigger( keepaliveEvent, settings );
$elm.data( "lastActivity", currentTime );
}
$elm.data( "lastActivity", currentTime );
}
} );
}

0 comments on commit 1e839a1

Please sign in to comment.
You can’t perform that action at this time.