I have the following problem :
I have a web application like a portal to many sites .
When i click a link to a web site on the portal then click Exit
to leave the portal ,the window to that site is still there and this is not secure at all because the user could forget to close the browser just after exit the portal .
Note:
Is there some way to enable me to leave all the pages after click exit button on the portal ?
that can be achieved if the pages you opened talk to the server periodically to see if the user is still logged in. – Vikdor 1 min ago edit
then how to do something like that .could u give me more details ? – just_name 12 secs ago
You can create an API on your server side that takes in a user name and returns true if the user's session has not been closed due to him pressing "Logout" in the parent window from where all these windows have been opened. Each child window would periodically (window.setInterval()
) sends an request to this API with the logged-in username to check if the user is still logged-in. When the API returns false, you will call the logout method on your client side that will log the user out and shows the login form or provides an option to go back to the parent page to start over.