diff --git a/session_security/static/session_security/script.js b/session_security/static/session_security/script.js
index <HASH>..<HASH> 100644
--- a/session_security/static/session_security/script.js
+++ b/session_security/static/session_security/script.js
@@ -83,8 +83,8 @@ yourlabs.SessionSecurity.prototype = {
             // Throttle these checks to once per second
             return;
 
+        var idleFor = Math.floor((now - this.lastActivity) / 1000);
         this.lastActivity = now;
-        var idleFor = Math.floor((new Date() - this.lastActivity) / 1000);
 
         if (this.$warning.is(':visible')) {
             // Inform the server that the user came back manually, this should
Check idleFor with lastActivity

When checking activity it should always compare the time vs how long the session has been idle and check it against the expire time that has been set.