DownloadAbout
Every online counter need a database, This class will not use a database, SQL or NoSQL or even flat-file.
It will use PHP session file located in php.ini session.save_path or session_save_path();
Usage
require_once 'online.php';
echo online::who();
It will return integer of total number of online users from last IDLE TIME ago.
Tip
-
To change IDLE TIME you can set `MAX_IDLE_TIME` to your preferred interval
-
In order to get more accurate number, you need to edit at least one of session key value pair in every page visit
-
In shared hosting environment, `session.save_path` need to be changed, do not use default path, because it returns a count of all sessions on the server for all sites
|