3
Quote:
ghia_ wrote:
I believe it takes the session duration from system preferences into account.
The online's data does not have a relation with the session's data.
The accuracy of this is handled in system/blocks/system_blocks.php
Look inside for this lines:
mt_srand((double)microtime()*1000000);
// set gc probabillity to 10% for now..
if (mt_rand(1, 100) < 11) {
$online_handler->gc(300);
}
This piece of code belongs to the online block and is responsible to delete online entries.
Being more specific:
One in each 10 times(10%) the online's block is renderered it will delete entries older than 5 minutes(300 seconds).
After this code the block just inserts fresh online data for the user that is seeing the page. It is necessary to have the block visible in all pages and for all users for the data to be correct.
Now, if you have very few visitors, you may want to increase the 10% to 50% or even 100% so the block can delete old entries often. Ex:
if (mt_rand(1, 100) < 51) {
Then you can set the period of time the data is related:
$online_handler->gc(120);
120 will give a 2 minutes(120 seconds) margin, if a user doesn´t refresh a page in 2 minutes it will not appear as online.(this does not affect the session, he could still be logged in)