Elgg\PersistentLoginService::setCookie PHP Method

setCookie() protected method

Store the token in the client cookie (or remove the cookie)
protected setCookie ( string $token ) : void
$token string Empty string to remove cookie
return void
    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);
    }