protected function setCookie($token)
{
$cookie = new \ElggCookie($this->cookie_config['name']);
foreach (array('expire', 'path', 'domain', 'secure', 'httponly') as $key) {
$cookie->{$key} = $this->cookie_config[$key];
}
$cookie->value = $token;
if (!$token) {
$cookie->expire = $this->time - 86400 * 30;
}
call_user_func($this->_callable_elgg_set_cookie, $cookie);
}