Checks agent cache

main
Yasen Pramatarov 2024-09-26 09:56:24 +03:00
parent ede9ecc7b6
commit ed2a058c12
1 changed files with 6 additions and 0 deletions

View File

@ -99,6 +99,12 @@ class Agent {
}
}
// check for agent cache
public function checkAgentCache($agent_id) {
$agent_cache_name = $agent_id . '_cache';
$agent_cache_time = $agent_id . '_time';
return isset($_SESSION[$agent_cache_name]) && isset($_SESSION[$agent_cache_time]) && (time() - $_SESSION[$agent_cache_time] < 600);
}
}