For a web application, how do I close all associated browser windows when a timeout session / user subscribes?
If you maintain links to any child windows, you can use window.close () in combination with setTimeout () .
As a side note, you should probably be careful when closing user windows, as this can potentially cause a bad user experience. Imagine I open my banking site to view transactions for an account so I can clear / reconcile them. But in the middle, I run off to grab lunch or something. When I return, I find that all my windows are closed and I have to rewrite, although I didn't need to, because I was just looking at a relatively static list of data. Or worse, if the window doesn't close properly, I might find that my browser is completely closed, which is definitely a bad experience.
source to share
not to do. As far as the typical user is concerned, your website does not have the right to close user windows and they will NOT HAVE your site if you try. If you believe your website relies on being able to close the user's browser to function properly, you are doing it wrong.
In addition, you cannot count on the success of your attempt to close user windows or similar actions. So take the time to get your website to work properly, no matter what the user is doing in the browser. It is also easier.
source to share