Ignition inactivity logout auto refresh or change page

I am currently using a SQL database to write to a table. Data is written to the SQL whenever a user with a specific role is logged in and navigates to a page using an onStartup script. The data is then added to the table. When the user logs out, an onShutdown script runs and removes them from the SQL database and table. If the browser is abruptly closed, once the session timeout is reached (currently 60 seconds for testing) they will be removed from the table.

However, when Ignition's built in inactivity timer logs them out, they are never removed from the database/table until they log back in. To my understanding this is because neither the onStartup or onShutdown script runs since the page does not refresh, change, or close.

The reason for all of this is to show where a user is currently at and (eventually) compare the data from one column (Page name, custom property) to warn a user if multiple people are currently accessing/modifying the same page.

I'm still fairly new to scripting, SQL, and Ignition in general, so I was pretty happy to even get the table part working.

Do you guys have any suggestions on how I should go about removing the user when Ignition's built in inactivity timer logs a user out? If I could set the inactive timer to log them out AND refresh the page or navigate to the "overview" screen, theoretically that would work. (Given that clicking logout refreshes the page and DOES remove them from the list)

Thanks in advance!

You could also create a gateway timer or scheduled script that queries your table and compares it against the list of current authenticated users then clean up your table.

What would I use to pull the list of authenticated users?

I feel like I had looked in to pulling authenticated users and using that for the table but was unable to get it working correctly.

Or where would a good starting point be?

You should be able to get the active sessions and the user names with