The conditional `if ($session)` was previously applied to this code;
restoring.
public static function cleanup($session = FALSE, $table = FALSE, $prevNext = FALSE) {
// first delete all sessions more than 20 minutes old which are related to any potential transaction
$timeIntervalMins = (int) Civi::settings()->get('secure_cache_timeout_minutes');
- if (TRUE) {
+ if ($timeIntervalMins && $session) {
$transactionPages = array(
'CRM_Contribute_Controller_Contribution',
'CRM_Event_Controller_Registration',