You are here

protected function FlagGlobalCookieStorage::get_lifetime in Flag 7.3

Same name and namespace in other branches
  1. 6.2 flag.inc \FlagGlobalCookieStorage::get_lifetime()
  2. 7.2 flag.inc \FlagGlobalCookieStorage::get_lifetime()
2 calls to FlagGlobalCookieStorage::get_lifetime()
FlagGlobalCookieStorage::flag in includes/flag.cookie_storage.inc
"Flags" an item.
FlagGlobalCookieStorage::unflag in includes/flag.cookie_storage.inc
"Unflags" an item.

File

includes/flag.cookie_storage.inc, line 83
Contains the FlagCookieStorage class.

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;
}