private static function CleantalkFuncs::_apbct_alt_sessions__remove_old in Anti Spam by CleanTalk 8.4
Same name and namespace in other branches
- 8.3 src/CleantalkFuncs.php \Drupal\cleantalk\CleantalkFuncs::_apbct_alt_sessions__remove_old()
- 9.1.x src/CleantalkFuncs.php \Drupal\cleantalk\CleantalkFuncs::_apbct_alt_sessions__remove_old()
Clean 'cleantalk_sessions' table
1 call to CleantalkFuncs::_apbct_alt_sessions__remove_old()
- CleantalkFuncs::apbct_setcookie in src/
CleantalkFuncs.php - Save our variables into cookies OR sessions
File
- src/
CleantalkFuncs.php, line 147
Class
- CleantalkFuncs
- Cleantalk class create request
Namespace
Drupal\cleantalkCode
private static function _apbct_alt_sessions__remove_old() {
if (rand(0, 1000) < APBCT_SESSION__CHANCE_TO_CLEAN) {
$connection = \Drupal::database();
$connection
->query("DELETE\n FROM {cleantalk_sessions}\n WHERE last_update < NOW() - INTERVAL " . APBCT_SESSION__LIVE_TIME . " SECOND\n LIMIT 100000;");
}
}