0

I have Client's website where only one user can be logged in, if another user try to login from another login page , it shows access denied. Now my client requested to put button on login page , when click on it , it will automatically logout the logged in user and closes all the related tabs. following things in tried

  1. Used LocalStorage Event (refereed from following Answer from Stack overflow)

    How user will Logout from all open tabs automatically when user logs out in one of them

    Problem: Dont Work in IE at all (as my client use only IE)

  2. Used Sessions

    Problem :same IE dont Support Session and LocalStorage

  3. Passing a Javascript window reference to the session https://bytes.com/topic/javascript/answers/861472-passing-javascript-window-reference-session Problem: blocked by Browser , seems like we cant store window object to session.

Any Suggestion or Advice , how can i do this?

hachi09
  • 21
  • 1
  • 6
  • You can use cookies and once user logs out, simply delete the cookie and he will be logged out from all other tabs. However make sure you check that cookie is present in every api call at backend. And, you can close other windows/tabs only if you have their reference i.e. it must be opened by your current window using window.open. Else, you cannot. – Adams Hales Nov 06 '19 at 12:36
  • See https://stackoverflow.com/a/28230846 - you can send message to other tabs so they can close themselves (the browser may sometimes show a warning that the tab wants to close itself) – IVO GELOV Nov 06 '19 at 14:43

0 Answers0