ng2-idle
                                
                                 ng2-idle copied to clipboard
                                
                                    ng2-idle copied to clipboard
                            
                            
                            
                        How to store data(ng2Idle.main.expiry) in sessionStorage Instead of localStorage??
I tried to find solution in ng2-idle documents but am not finding satisfactory information ,
The issue with if one browser window is active and other window timeout is not happening
is there any way to store data in session instead of localStorage???
Hi @madhujsmg do you find the solution ? I also want to use session instead of localStorage
I would really appreciate the solution
Implement your own provider for storing the data:
import { LocalStorage } from '@ng-idle/core';
export class MyStorage extends LocalStorage {
    constructor() {
        super();
        if (sessionStorage) {
          this['storage'] = sessionStorage;
        }
    }
}
and in your module:
import { LocalStorage } from '@ng-idle/core';
import { MyStorage } from './my-storage';
@NgModule({
  providers: [
    { provide: LocalStorage, useClass: MyStorage },
  ],
})
My personal suggestion to the maintainer of this repo is making the private storage a protected variable in the LocalStorage class.