function authcache_key_lifetime in Authenticated User Page Caching (Authcache) 7.2
Return the lifetime of authcache keys in seconds.
Defaults to the session.cookie_lifetime INI value. When this function returns zero, client code needs to choose an appropriate method such that the authcache key is stored temporary. For example only as long as a browser is open, or by specifying CACHE_TEMPORARY when the key is stored in a cache bin.
Related topics
7 calls to authcache_key_lifetime()
- AuthcacheBackendKeyManagementTestCase::testKeyRenewDuringLogin in tests/
authcache.backend.test - Call hook_authcache_backend_key_set during login and logout.
- AuthcacheBackendKeyManagementTestCase::testKeyRenewDuringLogout in tests/
authcache.backend.test - Call hook_authcache_backend_key_set during logout.
- AuthcacheVarnishTestCase::testGetKeyMenuCallback in modules/
authcache_varnish/ authcache_varnish.test - Cover authcache_varnish_get_key menu callback.
- authcache_exit in ./
authcache.module - Implements hook_exit().
- authcache_fix_cookies in ./
authcache.module - Add and remove cookies to the browser session as required.
6 string references to 'authcache_key_lifetime'
- AuthcacheBuiltinTestCacheBackend::testKeyExpiry in modules/
authcache_builtin/ tests/ authcache_builtin.cache-backend.test - Verify that the key cache is set with the proper values.
- AuthcacheBuiltinTestCacheBackend::testKeyLoginLogout in modules/
authcache_builtin/ tests/ authcache_builtin.cache-backend.test - Verify that the key cache is set with the proper values.
- AuthcacheVarnishTestCase::testGetKeyMenuCallback in modules/
authcache_varnish/ authcache_varnish.test - Cover authcache_varnish_get_key menu callback.
- authcache_admin_config in ./
authcache.admin.inc - Main Authcache configuration form.
- authcache_admin_config_submit in ./
authcache.admin.inc - Authcache config form submit.
File
- ./
authcache.module, line 674 - Authenticated User Page Caching (and anonymous users, too!)
Code
function authcache_key_lifetime() {
$lifetime = (int) variable_get('authcache_key_lifetime', ini_get('session.cookie_lifetime'));
return $lifetime > 0 ? $lifetime : 0;
}