I want to limit my users to be logged into only one device at a time.
So per @ed727’s suggestion I put the “Log Out Other User’s Sessions” action into my log in flow, so that when a user logs in, it logs them out of any other devices.
However I find this action is painfully slow. It takes about 30 or 60 seconds to complete.
Next, I tried putting the action into a backend workflow – but then it logs out of the current user’s session.
What is the proper way to use the “Log Out Other User’s Sessions” action?
Are you saying that when you add that workflow step it adds 30-60 seconds vs. not having it?
This is how I have mine set up and I don’t recall any slowdown when logging in.
Yes @ed727 , it’s slower vs not having the action to log user’s other sessions out.
Thanks for sharing your screenshot. I think your advantage is that the long action is your last action – this wouldn’t work on my app because, upon successful log in, I redirect the user to another page.
In your app, do you find that, immediately upon logging in, the app is responsive? In other words, you are sure there is not a 30-60 second task occurring in the background and preventing new workflows from initiating?
I recall my app being responsive upon login, but I’ll test it tomorrow.
The log out other sessions is something that is happening on Bubble’s end, so it shouldn’t bog down the browser, but perhaps the browser is waiting for a response from Bubble that confirms the action is complete.
Have you tried moving that log out other sessions workflow step to the page the user arrives at upon logging in? Put it as it’s own step that triggers when the page is loaded.
Just tested it. Had windows open in different browsers. I logged in on one browser – no delays. Then logged into on the other browser to see if being logged in somewhere else impacted things – but no delay, and it logged out the other session. Was able to navigate to another page immediately.
Maybe post screenshots of your workflows – might be something else happening. And also are you using any 3rd party plugins?
Thank you so much @ed727 for your help. Good to know that you have no issues, so my problem must be my own making.
Have you ever used Log Out Other Sessions in a backend workflow? I’d be curious to know if you found that it would log out the current user’s session (i.e. the user that created the backend workflow), which is what I experienced.
When I am able in a few days, I will try putting the action at the page load, per your suggestion. I’ll let you know how it goes
Just jumping in to give my opinion
It makes sense. When triggered by you, the term OTHER SESSIONS means every other session excluding your browser’s session.
When triggered by Bubble (as part of a backend workflow), the term OTHER SESSIONS means every other session excluding Bubble’s machine (what includes your browser’s session). That is why you are being logged out when trying to run this command in backend.
What @rpetribu says makes sense.
Regarding the log out other users command taking 30-60 seconds at the browser level, I wonder if the debugger can shed any light on the delay.
This topic was automatically closed after 70 days. New replies are no longer allowed.