Nette\Security\User::logout PHP Method

logout() public method

Logs out the user from the current session.
public logout ( $clearIdentity = FALSE ) : void
return void
    public function logout($clearIdentity = FALSE)
    {
        if ($this->isLoggedIn()) {
            $this->onLoggedOut($this);
            $this->storage->setAuthenticated(FALSE);
        }
        if ($clearIdentity) {
            $this->storage->setIdentity(NULL);
        }
    }

Usage Example

コード例 #1
0
ファイル: Panel.php プロジェクト: bauer01/fake-login
 public function onSuccessLoginForm()
 {
     if ($this->user->isLoggedIn()) {
         $this->user->logout(true);
     } else {
         $this->user->login($this->identity);
     }
     $this->redirect("this");
 }
All Usage Examples Of Nette\Security\User::logout