grbsk / ng-idle

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

Option to use sessionStorage #154

Open alexgoldstone opened 8 years ago

alexgoldstone commented 8 years ago

The library currently uses Window.localStorage this works well when sessions are supported across multiple browser tabs.

I would like the option to use Window.sessionStorage instead for use-cases where sessions are also stored in Window.sessionStorage and each tab is considered a different session.

djleonskennedy commented 8 years ago

Hello we've got session auth app, need to use sessionStorage only, any ideas to use sessionStorage?

grbsk commented 8 years ago

We could add an option to specify which one you want. Shouldn't be a big deal.

BaluVyamajala commented 7 years ago

Hello team! can you please confirm if this has been added?

ramparvataneni commented 5 years ago

Any update on using session storage? please let us know if we can find any sample how we can set to use session storage instead of local storage

fracz commented 4 years ago

Just replace the IdleStorageAccessor in your module:

.service('IdleStorageAccessor', ['$window', function($window) {
    return {
      get: function() {
        return $window.sessionStorage;
      }
    }
  }])