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
It will return integer of total number of online users from last IDLE TIME ago.
- 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