How to detect if a user is online - suggestions please

Mark Read

Well-Known Member
Licensed User
Longtime User
Since my last post, I have managed to install a web server on my NAS at home with mySQL and PHP. Users can read and write to the database. All is working. My App interface is simple but effective. Included is a login screen. Now I am stuck.

If a person logs in, a new "post" is generated to say they have joined the chat - ok so far. I would like to put the login in a new table with a boolean status: LoggedIn. I know I can read this easily but:

How do I do this in the background? Do I use a service which, via a timer, reads the table of users. I would need to compare two maps? to see which user status has changed and then maybe make a toast message.

Any other suggestions would be more than welcome.

Many thanks
Mark
 
Top