private static function CleantalkFuncs::_apbct_setcookie in Anti Spam by CleanTalk 7.4
Same name and namespace in other branches
- 7.5 src/CleantalkFuncs.php \CleantalkFuncs::_apbct_setcookie()
Save our variables into cookies OR sessions
Parameters
$name string Name of our variables to save:
$value string Value of our variables to save:
1 call to CleantalkFuncs::_apbct_setcookie()
File
- src/
CleantalkFuncs.php, line 82
Class
- CleantalkFuncs
- Cleantalk class create request
Code
private static function _apbct_setcookie($name, $value) {
if (variable_get('cleantalk_alternative_cookies_session', 0)) {
self::_apbct_alt_sessions__remove_old();
// Into database
db_query("INSERT INTO {cleantalk_sessions}\n (id, name, value, last_update)\n VALUES (:id, :name, :value, :last_update)\n ON DUPLICATE KEY UPDATE\n value = :value,\n last_update = :last_update", array(
':id' => self::_apbct_alt_session__id__get(),
':name' => $name,
':value' => $value,
':last_update' => date('Y-m-d H:i:s'),
));
}
else {
// Into cookies
setcookie($name, $value, 0, '/');
}
}