function user_cookie_delete

Same name in other branches
  1. 7.x modules/user/user.module \user_cookie_delete()
  2. 9 core/modules/user/user.module \user_cookie_delete()
  3. 8.9.x core/modules/user/user.module \user_cookie_delete()
  4. 10 core/modules/user/user.module \user_cookie_delete()

Delete a visitor information cookie.

Parameters

string $cookie_name: A cookie name such as 'homepage'.

File

core/modules/user/user.module, line 1039

Code

function user_cookie_delete($cookie_name) {
    setrawcookie('Drupal.visitor.' . $cookie_name, '', \Drupal::time()->getRequestTime() - 3600, '/');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.