function user_cookie_save
Same name in other branches
- 9 core/modules/user/user.module \user_cookie_save()
- 8.9.x core/modules/user/user.module \user_cookie_save()
- 10 core/modules/user/user.module \user_cookie_save()
- 11.x core/modules/user/user.module \user_cookie_save()
Saves visitor information as a cookie so it can be reused.
Parameters
$values: An array of key/value pairs to be saved into a cookie.
5 calls to user_cookie_save()
- comment_form_submit in modules/
comment/ comment.module - Process comment form submissions; prepare the comment, store it, and set a redirection target.
- contact_personal_form_submit in modules/
contact/ contact.pages.inc - Form submission handler for contact_personal_form().
- contact_site_form_submit in modules/
contact/ contact.pages.inc - Form submission handler for contact_site_form().
- openid_user_login in modules/
openid/ openid.module - Implements hook_user_login().
- system_admin_compact_page in modules/
system/ system.module - Menu callback; Sets whether the admin menu is in compact mode or not.
File
-
modules/
user/ user.module, line 4099
Code
function user_cookie_save(array $values) {
foreach ($values as $field => $value) {
// Set cookie for 365 days.
setrawcookie('Drupal.visitor.' . $field, rawurlencode($value), REQUEST_TIME + 31536000, '/');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.