grbsk / ng-idle

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

Ideal Max Time Setting for Idle Timeout #195

Closed Mr-Anonymous closed 7 years ago

Mr-Anonymous commented 7 years ago

If I have IdleProvider.idle(7200) set to 2 hours, would that affect the app performance? I know there is no set rule for this, but can someone share what is ideally the max time we could safely set for this plugin without worrying too much about the performance issue? My current setting is like this:

        IdleProvider.idle(7200);
        IdleProvider.timeout(300);
        KeepaliveProvider.interval(7200);

Is that too much?

grbsk commented 7 years ago

I'm aware of no inherent performance issues with using an idle time of that length, as internally it just uses setInterval. However, you may want to consider reducing the length of the keepalive duration. If that is also set to two hours, that means your server session has to be good for at least two hours. From a security standpoint, that seems like it might be too long, but then again I don't know what your needs are for your application.

Mr-Anonymous commented 7 years ago

Thank you Mike. Infact at the moment, I have the above settings set for 1 hour (3600s) in my production web app. But I am now creating a mobile app of the same application using ionic and thought for mobile apps, logging out in 1 hour might be too short since users might leave their app in their phone on standby more often than leaving tabs open in desktops. So I was pondering if increasing the limit to 2 hours might do create a balance between the web and mobile app. My server session token actually can last upto 8 hours unless they log out or have an idle timeout. I use the idle time plugin just to protect the information in an opened tab at the moment.

I thank you again Mike. This plugin is really useful from the security point of view and very easy to implement.

Cheers, Neel.

grbsk commented 7 years ago

Thanks! I'm glad you find it useful.