Is there a way to determine if someone is logged into a web app? I want to be able to update the file structure of a database by first checking to ensure that no one is using it.
Check App.SessionCount
. I usually implement a messaging system that alerts users that the system will be shutting down (using my own GraffitiSessionMessenger), disconnect the sessions, then perform the maintenance and updates while declining new sessions until it’s complete.
You can create a field in some control table as “maintenance_time” set as NULL or any old date like any before 2020 if your DB can’t hold a NULL there. To enter maintenance mode set it to a point in the future, and as soon as you reach 30 minutes to the event, you start to log out people as soon as possible and also preventing new logins based on the value of that field. Once the maintenance ends, reset the value to the operational one.
Good idea.
If you do this, make sure it doesn’t automatically log you out.
From my app? I clearly won’t be using it. I will be busy working on the backend upgrades with my superuser access to the systems.