# Configure Session and Token Lifetimes

Learn how to set how long users stay logged in to FusionAuth and to your applications.

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

Several settings decide how long a user stays logged in. Each setting controls a different session, so set each one with the others in mind. For what each session does, see [How Sessions Work](https://fusionauth.io/docs/authentication/sessions/how-sessions-work.md). For every field, unit, and default, see [Session Settings](https://fusionauth.io/docs/authentication/sessions/session-settings.md).

## Choose Lifetimes by Risk

Match lifetimes to what a stolen session could do. A banking or admin application needs short sessions and frequent logins. A content or community application can keep users logged in for weeks. When applications with different risk share a Tenant, set the Tenant values for the most common case and override the values on the riskier Applications. You can also require a fresh login for one application with `prompt=login` or `max_age`. For more information, see [Require a Fresh Login for One Application](https://fusionauth.io/docs/authentication/sessions/enable-sso.md#require-a-fresh-login-for-one-application).

Keep the lifetimes in the following order, from shortest to longest:

1.  **JWT duration**, so a revoked session stops working soon.
2.  Refresh token **Duration**, which bounds a [centralized session](https://fusionauth.io/docs/authentication/sessions/centralized-sessions.md).
3.  Your application session, so the application doesn't end a session that FusionAuth still considers valid.

FusionAuth applies lifetime changes to existing sessions and refresh tokens at the next check, not only to new ones. Shortening a lifetime can end sessions right away.

## Set the SSO Session Timeout

The **Session timeout** decides how long an idle [SSO session](https://fusionauth.io/docs/authentication/sessions/how-sessions-work.md#the-sso-session) lasts. Each SSO login to an application starts the timeout over. The timeout has no absolute maximum, so a user who logs in to an application through SSO at least once per timeout period stays logged in indefinitely.

1.  Navigate to Tenants -> Your Tenant -> OAuth .
2.  Set **Session timeout** in seconds.
3.  Click Save .

![The Session timeout field on the Tenant OAuth tab.](https://fusionauth.io/img/docs/screenshots/authenticate-tenant-oauth-session-timeout.png)

The SSO session spans every Application in the Tenant, so Applications can't override the timeout. To turn off SSO, change the theme rather than setting **Session timeout** to `0`. For more information, see [Create the SSO Session at Login](https://fusionauth.io/docs/authentication/sessions/enable-sso.md#create-the-sso-session-at-login).

## Set the Refresh Token Lifetime

Refresh tokens bound centralized sessions and decide how long a client can get new access tokens.

1.  Navigate to Tenants -> Your Tenant -> JWT .
2.  Under **Refresh Token settings**, set **Duration** in minutes.
3.  Set **Expiration policy**:
    *   `Fixed` ends the refresh token a fixed time after login. Use `Fixed` to force a login on a schedule.
    *   `Sliding window` ends the refresh token after a period without use. Use `Sliding window` for an idle timeout.
    *   `Sliding window with a maximum lifetime` adds an absolute limit to the sliding window. Use this policy for an idle timeout plus a forced login, such as 1 hour idle and 12 hours maximum.
4.  Click Save .

The sliding window counts only refresh grants. Retrieving a refresh token with the API doesn't count as use. For a centralized session that stays alive while the user is active, see [Check the Refresh Token on Each Request](https://fusionauth.io/docs/authentication/sessions/centralized-sessions.md#check-the-refresh-token-on-each-request).

To override the Tenant values for one Application, navigate to Applications -> Your Application -> JWT , turn on **Enable application-level JWT override**, and set the refresh token fields. The Application values don't apply to the SSO session.

## Set the Access Token Lifetime

Set **JWT duration** in seconds on the JWT tab of the Tenant, or of the Application to override the Tenant. Access tokens stay valid until the tokens expire, even after you revoke the refresh token, so keep the duration short. Many applications use 5 to 60 minutes.

## Set Your Application Session Lifetime

Configure your application's own session timeout in your framework. Without centralized sessions, the application session lifetime is the main control over how long a user stays logged in to that application. FusionAuth can't change the application session lifetime.

## Confirm the Result

To check the SSO session timeout, set **Session timeout** to a short value such as `120`. Log in to an application with **Keep me signed in** checked, wait past the timeout, and open a second application. FusionAuth shows the login form. Restore the timeout when you finish.

To see each session's expiration, navigate to Users -> The User -> Sessions .

Related

[Authentication Session and Token Lifetime Settings Reference for every FusionAuth setting that controls session, token, and logout behavior. sessionssession timeoutsession lifetime](https://fusionauth.io/docs/authentication/sessions/session-settings.md)

[Authentication How Sessions Work in FusionAuth Learn about the sessions that keep a user logged in to FusionAuth and to your applications, and how the sessions relate. sessionssso sessionrefresh tokens](https://fusionauth.io/docs/authentication/sessions/how-sessions-work.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. sessionssession timeoutrefresh tokens](https://fusionauth.io/docs/authentication/sessions.md)

[Authentication Troubleshoot Sessions and Logout Learn how to fix common problems with FusionAuth SSO, session lifetimes, and logout. sessionssession timeoutrefresh tokens](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.
- [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 Logout Works in FusionAuth](https://fusionauth.io/docs/authentication/sessions/how-logout-works.md): Learn about what each FusionAuth logout method ends, and how front-channel logout signs a user out of every application.
- [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.
