![]() |
Coders! Question for ya...
Is it possible to create a REAL-TIME User's Online script that doesn't use a time interval?
My site uses php sessions and I want to create a user's online script - but I want it to be as real-time as possible. |
Sure why not?... it's just session tracking.
If you get a lot of traffic you are going to bog down your site running queries for something sorta silly though. IMO anyway. T |
This is silly easy. In your config (or any file thats included in the main script thats setting the sessions) set the sessions dir using a set ini at the top. then do a dir listing on the dir every 30 seconds on a cron or other c app or something (you CAN do it on every load but thats just a server load problem) and count the number of sessions. so long as your php is cleaning up the old sessions quickly, it will return a good number. if you dont have any other sessions apps on your machine (check to make sure in php.ini that its not automatically starting sessions) you can even count the decault dir and not have to set ini it.
|
All times are GMT -7. The time now is 05:41 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123