1 session.inc _backdrop_session_delete_cookie($name, $secure = NULL)

Deletes the session cookie.

Parameters

$name: Name of session cookie to delete.

boolean $secure: Force the secure value of the cookie.

File

core/includes/session.inc, line 473
User session handling functions.

Code

function _backdrop_session_delete_cookie($name, $secure = NULL) {
  global $is_https;
  if (isset($_COOKIE[$name]) || (!$is_https && $secure === TRUE)) {
    $params = session_get_cookie_params();
    if ($secure !== NULL) {
      $params['secure'] = $secure;
    }
    setcookie($name, '', REQUEST_TIME - 3600, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
    unset($_COOKIE[$name]);
  }
}