示例#1
0
 /**
  * Logs the current user out.
  *
  * @return Response
  */
 public function logout()
 {
     $this->events->dispatch(AuthEvents::LOGOUT, $event = new LogoutEvent($this->user));
     $this->user = null;
     $this->session->invalidate();
     return $event->getResponse();
 }
 /**
  * Redirects a user after successful logout.
  *
  * @param LogoutEvent $event
  */
 public function onLogout(LogoutEvent $event)
 {
     $event->setResponse(new RedirectResponse($this->app['request']->get(Auth::REDIRECT_PARAM)));
 }