# How Logout Works in FusionAuth

Learn about what each FusionAuth logout method ends, and how front-channel logout signs a user out of every application.

> For the index of this section of the site, see [llms.txt](https://fusionauth.io/docs/llms.txt)

A user who logs in through FusionAuth holds several sessions at once. Logout has to end each one, and no single call ends them all. For the session types, see [How Sessions Work](https://fusionauth.io/docs/authentication/sessions/how-sessions-work.md).

## What Each Logout Method Ends

| Method | Called from | SSO session | Refresh tokens | Other applications' **Logout URL** |
| --- | --- | --- | --- | --- |
| [/oauth2/logout](https://fusionauth.io/docs/apis/oauth/logout.md) | Browser | Ends | Unchanged | Loaded, unless **Logout behavior** is `Redirect only` |
| [/api/logout](https://fusionauth.io/docs/apis/login/logout.md) | Browser or server, no API key | Unchanged | Revokes the one refresh token sent | Not loaded |
| [/api/logout](https://fusionauth.io/docs/apis/login/logout.md) with **`global`** set to `true` | Browser or server, no API key | Ends | Revokes all of the user's refresh tokens | Not loaded |
| [DELETE /api/jwt/refresh](https://fusionauth.io/docs/apis/jwt/revoke-refresh-tokens.md) | Server, with an API key | Ends when you revoke by user | Revokes by token, user, or Application | Not loaded |
| Admin UI Users -> The User -> Sessions | Admin UI | Ends when you delete the `single-sign-on` row | Revokes the rows you delete | Not loaded |
| [/account/logout](https://fusionauth.io/docs/users/account-management.md) | Browser | Ends, then continues to `/oauth2/logout` | Revokes the account management session | Loaded, as with `/oauth2/logout` |
| [SAML Single Logout](https://fusionauth.io/docs/authentication/act-as-an-idp/host-saml-idp.md#logout-request) | SAML service provider | Ends | Unchanged | With Single Logout enabled, sends SAML logout requests to the other service providers in the session |

No method ends an access token that a client already holds. The access token stays valid until the token expires.

No method ends an upstream [Identity Provider](https://fusionauth.io/docs/authentication/identity-providers.md) session. A user who logs in with Google and then logs out of FusionAuth stays logged in to Google. For a workaround, see [Log Out of an Identity Provider](https://fusionauth.io/docs/authentication/sessions/log-users-out.md#log-out-of-an-identity-provider).

## Front-Channel Logout

FusionAuth implements [OpenID Connect Front-Channel Logout](https://openid.net/specs/openid-connect-frontchannel-1_0.html) at `/oauth2/logout`. Your application ends the local session, then redirects the browser to `/oauth2/logout`. FusionAuth ends the SSO session and renders a logout page.

The logout page loads the **Logout URL** of every Application in the Tenant in a hidden iframe. FusionAuth loads every Application that has a **Logout URL**, including Applications the user never logged in to. FusionAuth appends the `iss` and `sid` parameters to each URL. Code at each **Logout URL** ends that application's session. When the iframes finish, FusionAuth redirects the browser to the `post_logout_redirect_uri`, or to the **Logout URL** of the Application that started the logout.

```mermaid
sequenceDiagram
    participant Browser
    participant A as Application A
    participant FusionAuth
    participant B as Application B
    Browser ->> A : Click Logout
    A ->> A : End the application session
    A ->> Browser : Redirect to /oauth2/logout
    Browser ->> FusionAuth : Request /oauth2/logout
    FusionAuth ->> FusionAuth : End the SSO session
    FusionAuth ->> Browser : Logout page with an iframe for each Logout URL
    Browser ->> B : Load the Logout URL in an iframe
    B ->> B : End the application session
    FusionAuth ->> Browser : Redirect to Application A's Logout URL
```

Front-channel logout across two applications.

Each iframe loads a different site than the FusionAuth page. The browser sends the application's session cookie to the iframe only when the cookie allows cross-site use. Set the application's session cookie to `SameSite=None; Secure`, which requires HTTPS. Browsers that block third-party cookies can still drop the cookie. When the iframe can't read the session cookie, the code at the **Logout URL** can't find the session to end. For a design that doesn't depend on cookies in iframes, use [centralized sessions](https://fusionauth.io/docs/authentication/sessions/centralized-sessions.md).

## Logout Behavior

Each Application's **Logout behavior** setting controls what happens when logout starts from that Application:

*   `All applications` loads every **Logout URL** in the Tenant, then redirects. `All applications` is the default.
*   `Redirect only` ends the SSO session and redirects, without loading the other applications' **Logout URL**. The other applications keep their sessions.

With either value, `/oauth2/logout` ends the SSO session. The next login redirect from any application shows the login form.

## Back-Channel Logout

FusionAuth doesn't implement [OpenID Connect Back-Channel Logout](https://openid.net/specs/openid-connect-backchannel-1_0.html). To end sessions from a server without a browser, use centralized sessions and revoke refresh tokens with the API. For the steps, see [View and Revoke Sessions](https://fusionauth.io/docs/authentication/sessions/revoke-sessions.md).

Related

[Authentication Log Users Out of FusionAuth and Your Applications Learn how to log users out of one application or every application, and where to send users after logout. logoutsign outlog out](https://fusionauth.io/docs/authentication/sessions/log-users-out.md)

[Authentication Sessions, SSO, and Logout Learn about how FusionAuth keeps users logged in across applications, and how to configure session lifetimes, single sign-on, and logout. sessionsssologout](https://fusionauth.io/docs/authentication/sessions.md)

[Authentication View and Revoke User Sessions Learn how to list a user's sessions and end the sessions from the Admin UI, the API, or automatically. sessionsrefresh tokenslogout](https://fusionauth.io/docs/authentication/sessions/revoke-sessions.md)

[Authentication Troubleshoot Sessions and Logout Learn how to fix common problems with FusionAuth SSO, session lifetimes, and logout. sessionsssologout](https://fusionauth.io/docs/authentication/sessions/troubleshooting.md)
---

## Other pages in Sessions

> For the full index of this section, see [Authentication](https://fusionauth.io/docs/llms-authentication.txt).

- [Manage Application Sessions in FusionAuth With Refresh Tokens](https://fusionauth.io/docs/authentication/sessions/centralized-sessions.md): Learn how to track and revoke application sessions in FusionAuth by tying each session to a refresh token.
- [Configure Session and Token Lifetimes](https://fusionauth.io/docs/authentication/sessions/configure-session-lifetimes.md): Learn how to set how long users stay logged in to FusionAuth and to your applications.
- [Login Page Cookies](https://fusionauth.io/docs/authentication/sessions/cookies.md): Reference for the cookies that FusionAuth sets in the browser, including the SSO session cookie.
- [Enable SSO Across Applications](https://fusionauth.io/docs/authentication/sessions/enable-sso.md): Learn how to let users log in once and reach every application in a FusionAuth tenant without logging in again.
- [How Sessions Work in FusionAuth](https://fusionauth.io/docs/authentication/sessions/how-sessions-work.md): Learn about the sessions that keep a user logged in to FusionAuth and to your applications, and how the sessions relate.
- [Sessions, SSO, and Logout](https://fusionauth.io/docs/authentication/sessions.md): Learn about how FusionAuth keeps users logged in across applications, and how to configure session lifetimes, single sign-on, and logout.
- [Limit How Many Devices a User Can Log In From](https://fusionauth.io/docs/authentication/sessions/limit-concurrent-sessions.md): Learn how to cap the number of devices a user can stay logged in on at the same time.
- [Log Users Out of FusionAuth and Your Applications](https://fusionauth.io/docs/authentication/sessions/log-users-out.md): Learn how to log users out of one application or every application, and where to send users after logout.
- [View and Revoke User Sessions](https://fusionauth.io/docs/authentication/sessions/revoke-sessions.md): Learn how to list a user's sessions and end the sessions from the Admin UI, the API, or automatically.
- [Session and Token Lifetime Settings](https://fusionauth.io/docs/authentication/sessions/session-settings.md): Reference for every FusionAuth setting that controls session, token, and logout behavior.
- [Troubleshoot Sessions and Logout](https://fusionauth.io/docs/authentication/sessions/troubleshooting.md): Learn how to fix common problems with FusionAuth SSO, session lifetimes, and logout.
