Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any support for multi-tabbing? #18

Open
LessThanInfinity-zz opened this issue May 5, 2015 · 7 comments
Open

Any support for multi-tabbing? #18

LessThanInfinity-zz opened this issue May 5, 2015 · 7 comments

Comments

@LessThanInfinity-zz
Copy link

Hello,

I wonder if this library has any support for multi-tabbing? I've been using BootStrap Session Timeout and it works wonderfully, but I've come to this issue:

If I have more than one tab open, each tab has its own timeout fired. So, let's say I'm working with 3 tabs, and my timeout is set to 5 minutes. If I'm working with tab#3 and haven't opened tab#1 or tab#2 in 5 minutes, my application logout function is fired, and therefore I lose whatever work I do in tab#3.

I wonder if we have anything right now to deal with that? For example, something to communicate with localStorage timer wise?

@LessThanInfinity-zz LessThanInfinity-zz changed the title Any support for mulit-tabbing? Any support for multi-tabbing? May 5, 2015
@vedraan
Copy link
Contributor

vedraan commented May 25, 2015

Hi, I think this might be possible using localstorage as described here http://ponyfoo.com/articles/cross-tab-communication. Shared web workers which are not yet supported by Internet explorer: https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker
The only other way to do it would be using a server side script to register and keep timers in sync which would over-complicate the plugin.
I will try my best to implement localstorage with the next version of the plugin.

@clemsontiger
Copy link

any update on implementing the localstorage option?

@clemsontiger
Copy link

2 years later, any update on implementing the localstorage option? finally going to use this plugin and this would be great.

@clemsontiger
Copy link

@Shak-eah did you ever find a solution for the multi tabbing? if so, could you share?

@LessThanInfinity-zz
Copy link
Author

Good god, it's been two years. =[ I've become that guy on the github forum. Terribly sorry. The implementation I did back then was a hacky way. To the best of my memory, I added an observer to my Ember application that observed localstorage directly and then made changes to this library, but it was quickly rejected and caused problems keeping things in sync. We ended up scrapping the timeout project since we ended up using Auth-0's JWT token implementation (the switch to which was made for reasons much more weighty than just a timer).

My apologies on not updating this. The only headway I made back then was to make sure that Tab 1 would not time out if I was working on Tab4 by using an Ember observer to update the component I wrapped this library in.

@clemsontiger
Copy link

@Shak-eah ha, sorry. Appreciate the reply though. Taking a look at a similar plugin that handles multiple tabs. but thanks.

@willseward
Copy link

FYI: I just submitted a PR for this: #49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants