You are here

function session_cache_cron in Session Cache API 6

Same name and namespace in other branches
  1. 8 session_cache.module \session_cache_cron()

Implements hook_cron().

File

./session_cache.module, line 109
session_cache.module

Code

function session_cache_cron() {
  if (variable_get('session_cache_storage_method', SESSION_CACHE_STORAGE_SESSION) == SESSION_CACHE_STORAGE_DB_CORE) {

    // Delete only the expired cache_session_cache entries.
    // Note: to avoid the clear() function setting $_SESSION['cache_expiration'][..],
    // the cache lifetime should not be configured, ie cache_lifetime==0.
    // This will also stop the cache's garbage collection.
    cache_clear_all(NULL, 'cache_session_cache');
  }
}