You are here

private static function CleantalkFuncs::_apbct_alt_sessions__remove_old in Anti Spam by CleanTalk 7.5

Same name and namespace in other branches
  1. 7.4 src/CleantalkFuncs.php \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 148

Class

CleantalkFuncs
Cleantalk class create request

Code

private static function _apbct_alt_sessions__remove_old() {
  if (rand(0, 1000) < APBCT_SESSION__CHANCE_TO_CLEAN) {
    db_query("DELETE\n      FROM {cleantalk_sessions}\n      WHERE last_update < NOW() - INTERVAL " . APBCT_SESSION__LIVE_TIME . " SECOND\n      LIMIT 100000;");
  }
}