How is the user logout process supposed to work? I’ve built a complete private site. Everything seems to work. When users wants to  log out, they are redirect from /user/logout /user/login?destination=/, which seems the normal behavior, for what I understand.

A client told me he is not redirected to /user/login?destination=/ but stays on /user/logout, getting an Access Denied error.

I can’t reproduce this issue.

How is the logout supposed to work? Is the redirect from /user/logout to /user/login?destination=/ the normal behavior?
Is the redirect from /user/logout to /user/login?destination=/


No, the normal behavior is to redirect to the frontpage. You probably have a module installed which issues a second redirect when the logged out user doesn't have access to the frontpage.


  How is the user logout process supposed to work?


This is the core controller as example:

UserController::logout

  /**
   * Logs the current user out.
   *
   * @return \Symfony\Component\HttpFoundation\RedirectResponse
   *   A redirection to home page.
   */
  public function logout() {
    user_logout();
    return $this-&gt;redirect('&lt;front&gt;');
  }


So you only need to call user_logout() in custom code to implement your own logout.