forked from JillElaine/jquery-idleTimeout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
58 lines (44 loc) · 2.58 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>jquery-idleTimeout - Example Page</title>
<link type="text/css" rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/ui-lightness/jquery-ui.min.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js" type="text/javascript"></script>
<script src="/js/store.min.js" type="text/javascript"></script>
<script src="/js/jquery-idleTimeout.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function (){
$(document).idleTimeout({
idleTimeLimit: 1200000, // 'No activity' time limit in milliseconds. 1200000 = 20 Minutes
dialogDisplayLimit: 180000, // Time to display the warning dialog before redirect (and optional callback) in milliseconds. 180000 = 3 Minutes
redirectUrl: '/logout', // redirect to this url. Set this value to YOUR site's logout page.
// optional custom callback to perform before redirect
customCallback: false, // set to false for no customCallback
// customCallback: function () { // define optional custom js function
// perform custom action before logout
// },
// configure which activity events to detect
// http://www.quirksmode.org/dom/events/
// https://developer.mozilla.org/en-US/docs/Web/Reference/Events
activityEvents: 'click keypress scroll wheel mousewheel mousemove', // separate each event with a space
//dialog box configuration
enableDialog: true,
dialogTitle: 'Session Expiration Warning',
dialogText: 'Because you have been inactive, your session is about to expire.',
// server-side session keep-alive timer & url
sessionKeepAliveTimer: 60000, // Ping the server at this interval in milliseconds. 60000 = 1 Minute
// sessionKeepAliveTimer: false, // Set to false to disable pings.
sessionKeepAliveUrl: '/', // url to ping
});
});
</script>
</head>
<body>
<h1>jquery-idleTimeout Example Page</h1>
<p>This is an example of how to set up a webpage to use the jquery-idleTimeout.</p>
<p>You must change the 'redirectUrl' configuration value to point to your site's logout page.</p>
<p>All other configuration values can be run at their default setting.</p>
</body>
</html>