function FlagGlobalCookieStorage::flag in Flag 7.3
Same name and namespace in other branches
- 6.2 flag.inc \FlagGlobalCookieStorage::flag()
- 7.2 flag.inc \FlagGlobalCookieStorage::flag()
"Flags" an item.
It just records this fact in a cookie.
Overrides FlagCookieStorage::flag
File
- includes/
flag.cookie_storage.inc, line 70 - Contains the FlagCookieStorage class.
Class
- FlagGlobalCookieStorage
- Storage handler for global flags.
Code
function flag($entity_id) {
$cookie_key = $this
->cookie_key($entity_id);
setcookie($cookie_key, 1, REQUEST_TIME + $this
->get_lifetime(), base_path());
$_COOKIE[$cookie_key] = 1;
}