Flarum\Http\SessionAuthenticator::logOut PHP Method

logOut() public method

public logOut ( Symfony\Component\HttpFoundation\Session\SessionInterface $session )
$session Symfony\Component\HttpFoundation\Session\SessionInterface
    public function logOut(SessionInterface $session)
    {
        $session->invalidate();
    }

Usage Example

コード例 #1
0
ファイル: LogOutController.php プロジェクト: asifalimd/core
 /**
  * @param Request $request
  * @return \Psr\Http\Message\ResponseInterface
  * @throws TokenMismatchException
  */
 public function handle(Request $request)
 {
     $session = $request->getAttribute('session');
     $response = new RedirectResponse($this->app->url());
     if ($user = User::find($session->get('user_id'))) {
         if (array_get($request->getQueryParams(), 'token') !== $session->get('csrf_token')) {
             throw new TokenMismatchException();
         }
         $this->authenticator->logOut($session);
         $user->accessTokens()->delete();
         $this->events->fire(new UserLoggedOut($user));
         $response = $this->rememberer->forget($response);
     }
     return $response;
 }
All Usage Examples Of Flarum\Http\SessionAuthenticator::logOut
SessionAuthenticator