How can I prevent multiple users from being logged in at the same time with a single user ID?

I searched the internet and found some ways, but they do not work in these situations:

  1. If JavaScript in the browser is turned off.
  2. If the user does not click "logout" and instead directly closes the browser.

Suggestions would be appreciated. Thanks.

Edit
Report