UserController::logout

public UserController::logout()

Logs the current user out.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse A redirection to home page.

File

core/modules/user/src/Controller/UserController.php, line 280

Class

UserController
Controller routines for user routes.

Namespace

Drupal\user\Controller

Code

public function logout() {
  user_logout();
  return $this->redirect('<front>');
}
doc_Drupal
2016-10-29 09:52:27
Comments
Leave a Comment

Please login to continue.