grbsk / ng-idle

Responding to idle users in AngularJS applications.
http://hackedbychinese.github.io/ng-idle
MIT License
564 stars 196 forks source link

ngIdle.expiry, the local storage object value, keeps extending without any interrupt() or watch() calls #110

Open pushkarajc opened 9 years ago

pushkarajc commented 9 years ago

Here's my setup:

.config(['IdleProvider', function(IdleProvider) {
        IdleProvider.interrupt('keydown DOMMouseScroll mousewheel mousedown touchstart touchmove scroll');
        //IdleProvider.autoResume('notIdle');
        IdleProvider.autoResume(false);
        IdleProvider.keepalive(false);
}])

.run(['Idle', function(Idle){
  // start watching when the app runs. also starts the Keepalive service by default.
  Idle.watch();
}])

// Here, I set the values for idle and timeout
        $rootScope.$on("sessionTimeoutValueReceived", function(){
            console.log("Idle and timeout settings set.");
            Idle.setIdle((model.sessionIdleWarning/1000)); // in seconds(Warning timeout = Logout Timeout - 10 minutes)
            Idle.setTimeout(model.sessionTimeout/1000); // in seconds

        });

Here's what I'm seeing. After a few minutes of inactivity,a storage event got fired, caught by "wrap()" and I notice that it added 9 minutes to my already set expiry. I had a breakpoint on watch(), interrupt(), and none of those were involved in increasing this value.

azizalibasic commented 8 years ago

@pushkarajc did you ever solve this?