From eba4d767fe9706933da69059c153fd7ddda3d6f4 Mon Sep 17 00:00:00 2001
From: Tim Otten <totten@civicrm.org>
Date: Thu, 18 Aug 2016 14:45:29 -0700
Subject: [PATCH] CRM-12132 - Make special timeout for event/contrib
 conditional

The conditional `if ($session)` was previously applied to this code;
restoring.
---
 CRM/Core/BAO/Cache.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CRM/Core/BAO/Cache.php b/CRM/Core/BAO/Cache.php
index a901331290..b295950417 100644
--- a/CRM/Core/BAO/Cache.php
+++ b/CRM/Core/BAO/Cache.php
@@ -306,7 +306,7 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache {
   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',
-- 
2.25.1