$scopes = explode(",", $_GET['scope']); if (is_array($tokens)) { foreach ($scopes as $s) { $temp_bool = false; foreach ($tokens as $key => $value) { if ($key == $s) { $expires_at = $_SESSION['consent_expires_at'][$key]; $time_now = getdate()[0]; $expires_in = $expires_at - $time_now - $reduce_token_expiry_by; if ($expires_in > 0) { $bool = "true"; $temp_bool = true; } else { $html5_provider = new Html5_ServiceProvider_Base_Att($config); // Try to get the token, this will try the refresh logic $token = $html5_provider->getSessionConsentToken($key); if ($token != null) { $bool = "true"; $temp_bool = true; } } } } if (!$temp_bool) { $bool = "false"; break; } } } } header("Content-Type:application/json");