First off, apologies if the title isn't descriptive. What I'm trying to do is logout/expire from a session no matter how many tabs are open.
So to explain a bit more in detail, let's say I have all tabs open. After a certain time of inactivity a modal will open and will show up in all tabs (which already works and happens). When I click on the main window, it executes the functions as I'd expect. It fires expire, then it logs out, then it redirects.
The issue is when I'm clicking on the logout from the modal in Tab 2 or 3, it is running the expire, logging out then redirecting.
What should happen is T1 should fire the expire, logout for all tabs and then each tab will do it's own redirect.
I have tried by passing functions to windows by their name but the tabs don't have reference to each window name, only their own. I believe this is something to do with Execution Context but I'm not 100% sure. There is code for adding each Tab that's opened to sessionStorage as an App but it's only storing the basic information, not the context of the App.
I'm coming into someone else's code and trying to wrap my head around what was written and the change that has to be done.
Any help would be greatly appreciated.
For example:
Tab 1: This is the main window and should handle all the execution of scripts and ajax/network calls.
Tab 2: Is an application launched from Tab 1. When the modal shows up and I click a button, execution of ajax requests should not be handled in this tab but Tab 1. After Tab 1 finishes all the calls, then Tab 2 will redirect to a landing page.
Tab 3: Is an application launched from Tab 1. When the modal shows up and I click a button, execution of ajax requests should not be handled in this tab but Tab 1. After Tab 1 finishes all the calls, then Tab 3 will redirect to a landing page.