user_cookie_save

user_cookie_save(array $values)

Saves visitor information as a cookie so it can be reused.

Parameters

array $values: An array of key/value pairs to be saved into a cookie.

File

core/modules/user/user.module, line 1287
Enables the user registration and login system.

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, '/');
  }
}
doc_Drupal
2016-10-29 09:53:14
Comments
Leave a Comment

Please login to continue.