HTMLGuyLLC / jTimeout

jQuery session timeout handler
https://htmlguyllc.github.io/jTimeout/
MIT License
16 stars 18 forks source link

Change decrement logic #17

Closed ggirard closed 6 years ago

ggirard commented 6 years ago

Decrements the quantity of second by the difference of the current time and the last tab date.

The decrements by the heartbeat was causing a bug in our application. The session of our users is 90 minutes. Some of them was putting their computer in sleep and then try to continue their session when they return because the pop-up was not showing up. This implementation prevents that.

HTMLGuyLLC commented 6 years ago

Please update the minified version as well. Thank you for your contribution!

HTMLGuyLLC commented 6 years ago

It's counting down too quickly now.

HTMLGuyLLC commented 6 years ago

This was after 30 seconds (Top one is a simple setInterval for each second and removes 1 from the count. Bottom one uses the logic you provided) screen shot 2018-08-12 at 3 08 00 pm

HTMLGuyLLC commented 6 years ago

Ok, rewritten to remove tab identification and countdown logic. That was dumb in the first place. Now uses a super reliable timestamp expiration date. Please see latest version (3.0)