Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- idleTime = 0;
- $(document).ready(function () {
- //Increment the idle time counter every minute.
- var idleInterval = setInterval(timerIncrement, 60000); // 1 minute
- //Zero the idle timer on mouse movement.
- $(this).mousemove(function (e) {
- idleTime = 0;
- });
- $(this).keypress(function (e) {
- idleTime = 0;
- });
- });
- function timerIncrement() {
- idleTime = idleTime + 1;
- if (idleTime > 15) { // 15 minutes
- window.location.href= "<?php echo this()->base;?>index.php/webadmin/user/logout";
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement