Hello @PyGuy,
You may be able to use something like this:
Basically, on a db you keep track of the last callback executed by the user, could listen on the server using the flask.before_request method to do that.
Then have a function that checks logged in users and their last activity time, if it is outside of the time frame, then you send a message and when the message is received it causes them to log out.
This might be easier to perform on something like a quartz server too, but a little more tricky to have the socket have the user info, since that info is in a different server.