Allow for triggering idle and resume manually. #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am using this plugin to manage the user session in my application, but we needed it to work across multiple tabs/windows. Here's the scenario. User logs in and navigates to a page in our application, and then opens a new tab for a different page in our application (e.g. a list of items for the first tab, and the detail page for a specific item as the second tab). If the user works in the second tab for a while and doesn't return to the first one, the timeout fires on that first tab even though they're still active, logs them out after the countdown, and then the second tab behaves badly. At best it redirects to the login page, but ajax requests from that page return strange results.
My solution was to use SignalR to communicate between windows and allow one window to cancel the countdown in another window and then start the countdown when the last window to the application has gone idle. I had to make a small change to the plugin to allow me to do this, so that's what I'm requesting a pull for.
I'd like to package my entire solution (along with the idleTimer and idleTimeout files) and put it on NuGet, but I haven't done that before, so we'll see if I can get that to happen.