protected function FlagGlobalCookieStorage::get_lifetime in Flag 7.2
Same name and namespace in other branches
- 6.2 flag.inc \FlagGlobalCookieStorage::get_lifetime()
- 7.3 includes/flag.cookie_storage.inc \FlagGlobalCookieStorage::get_lifetime()
2 calls to FlagGlobalCookieStorage::get_lifetime()
- FlagGlobalCookieStorage::flag in ./
flag.inc - "Flags" an item.
- FlagGlobalCookieStorage::unflag in ./
flag.inc - "Unflags" an item.
File
- ./
flag.inc, line 1938 - Implements various flags. Uses object oriented style inspired by that of Views 2.
Class
- FlagGlobalCookieStorage
- Storage handler for global flags.
Code
protected function get_lifetime() {
$cookie_lifetime = variable_get('cache', 0) ? variable_get('cache_lifetime', 0) : -1;
// Do not let the cookie lifetime be 0 (which is the no cache limit on
// anonymous page caching), since it would expire immediately. Usually
// the no cache limit means caches are cleared on cron, which usually runs
// at least once an hour.
if ($cookie_lifetime == 0) {
$cookie_lifetime = 3600;
}
return $cookie_lifetime;
}