A1_Core::logout PHP Method

logout() public method

Log out a user by removing the related session variables.
public logout ( $destroy = FALSE ) : boolean
return boolean
    public function logout($destroy = FALSE)
    {
        unset($this->_user);
        if (Cookie::get($this->_config['cookie']['key'])) {
            Cookie::delete($this->_config['cookie']['key']);
        }
        if ($destroy === TRUE) {
            $this->session()->destroy();
        } else {
            $this->session()->delete($this->_config['session']['key']);
            $this->session()->regenerate();
        }
        return !$this->logged_in();
    }