users – Restricting wordpress login sessions for a web app
I am creating a webgl unity app that sits on a wp site and uses the wp accounts to store data. It works really well, however an issue I have is that currently a user can be logged in on two machines at once, and therefore use the app with the same account on two machines concurrently. Is there any way I can prevent this from happening? I have tried a few plugins that prevent simultaneous logins, however all of them assume that the user will be refreshing/changing page often, and so do not work for an app where you will stay on the same page for the whole session.
As I type this I’ve realised a potential workaround is setting some sort of flag in the database when the app starts and checking for it on login/clearing it when the game ends, but that sounds a bit janky and I am not sure how reliable onapplicationquit is in webgl, so would prefer a wp based solution rather than unity. Any ideas? Thanks in advance.
Leave an answer