Reputation: 77
If we use same application in multiple tabs, both application uses the same localstorage for storing ngIdle.expiry and one application extends the session of other one. Is there any work around to fix this issue in current version, like configure sessionstorage instead of localstorage or like change the id field in the ngIdle.expiry.
Upvotes: 0
Views: 3308
Reputation: 119
I know this is old, but for other people searching this topic, yes there is a built in way to do this if you're using ng2-idle (Angular 2+).
In your app.module.ts, in the provider section you need to provide the SimpleExpiry:
@NgModule({
declarations: [ . . .],
imports: [ . . . ],
providers: [
. . .
{
provide: IdleExpiry,
useClass: SimpleExpiry
}
]
See https://github.com/moribvndvs/ng2-idle#extensible-expiry for more information.
Upvotes: 2