function GetUsersOnline(){
clearstatcache();
$SessionDir = session_save_path();
$Timeout = 60 * 3;
if ($Handler = scandir ($SessionDir)){
$count = count ($Handler);
$users = 0;
for ($i = 2; $i < $count; $i++){
if (time() - fileatime ($SessionDir . '/' . $Handler[$i]) < $Timeout){
$users++;
}
}
return $users;
} else {
return 'error';
}
}