Im want to properly display a list of member usernames currently online. The way that Im currently doing does not seem to work. Im using Coldfusion session to do this, here is my MSSQL database structure.
Id (int- auto increment)
Username (varchar 20)
Password (varchar 15)
Online_status (tinyint default 0)
1. when user successfully logs in:
a. update the online_status to 1
b. update the session_id with CFID
c. update the session_time with timeformat(now())
When the members actually click on the logout button I simply:
2. update online_status to 0
Now the problem is that when member DONT log out or idle for hours. Ive tried several way but had no luck, I cant seem to figure this out.
What I tried was to loop through the user table with this query below and see if there session_id still exist. But the syntax that I used was incorrect.
Where online_status = 1
HELP please! Thank you in advance for your help.