> ## Documentation Index
> Fetch the complete documentation index at: https://auth0.generaltranslation.app/llms.txt
> Use this file to discover all available pages before exploring further.

> Describes how to configure session lifetime for a tenant using the Auth0 Dashboard, the Management API and Actions.

# Configure Session Lifetime

To configure a session lifetime, you can use the Auth0 [Dashboard](/docs/get-started/auth0-overview/dashboard), [Management API](https://auth0.com/docs/api/management/v2), or a [Post-Login Action](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger).

## Auth0 Dashboard

To configure the session lifetime using Auth0 Dashboard:

1. Navigate to **Dashboard > Tenant Settings** and select the **Advanced** view.

2. Under **Session Expiration**, you can configure:

<table class="table">
  <thead>
    <tr>
      <th><strong>Session Policy</strong></th>
      <th><strong>Description</strong></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><strong>Idle Session Lifetime (Persistent)</strong></td>
      <td>Maximum time (in minutes) of inactivity before a persistent session expires.</td>
    </tr>

    <tr>
      <td><strong>Idle Session Lifetime (Non-Persistent)</strong></td>
      <td>Maximum time (in minutes) of inactivity before a non-persistent session expires.</td>
    </tr>

    <tr>
      <td><strong>Maximum Session Lifetime  (Persistent)</strong></td>
      <td>Maximum time (in minutes) a persistent session can exist, even if the user is active.</td>
    </tr>

    <tr>
      <td><strong>Maximum Session Lifetime (Non-Persistent)</strong></td>
      <td>Maximum time (in minutes) a non persistent session can exist, even if  the user is active.</td>
    </tr>
  </tbody>
</table>

<Frame>
  <img src="https://mintcdn.com/generaltranslationinc/md6b8ua1hdYa2pM7/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?fit=max&auto=format&n=md6b8ua1hdYa2pM7&q=85&s=40aa63991c74735b8dfedf40f8ae98cb" alt="Dashboard > Tenant > Settings > Advanced > Session Expiration" data-og-width="1404" width="1404" data-og-height="995" height="995" data-path="docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/generaltranslationinc/md6b8ua1hdYa2pM7/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?w=280&fit=max&auto=format&n=md6b8ua1hdYa2pM7&q=85&s=de2a7f7abe531ce435872f6474734b08 280w, https://mintcdn.com/generaltranslationinc/md6b8ua1hdYa2pM7/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?w=560&fit=max&auto=format&n=md6b8ua1hdYa2pM7&q=85&s=838f598c4eeea229a88e1b3c9dace849 560w, https://mintcdn.com/generaltranslationinc/md6b8ua1hdYa2pM7/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?w=840&fit=max&auto=format&n=md6b8ua1hdYa2pM7&q=85&s=984631abca7ea3f16b8ee0a7a962c718 840w, https://mintcdn.com/generaltranslationinc/md6b8ua1hdYa2pM7/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?w=1100&fit=max&auto=format&n=md6b8ua1hdYa2pM7&q=85&s=beaf4c925cf7a33e863021e6116ec13c 1100w, https://mintcdn.com/generaltranslationinc/md6b8ua1hdYa2pM7/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?w=1650&fit=max&auto=format&n=md6b8ua1hdYa2pM7&q=85&s=4ee87e5e88b1da092d5027d9cba0296a 1650w, https://mintcdn.com/generaltranslationinc/md6b8ua1hdYa2pM7/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?w=2500&fit=max&auto=format&n=md6b8ua1hdYa2pM7&q=85&s=91408492833ba05a5cd4598d1da44324 2500w" />
</Frame>

## Auth0 Management API

To configure the session lifetime using the Auth0 Management API:

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  Calls to the `/api/v2/tenants/settings` endpoint require a [Management API access token](/docs/secure/tokens/access-tokens) with the `update:tenant_settings` scope.
</Callout>

Make a `PATCH` request to the [/api/v2/tenants/settings](/docs/api/management/v2/tenants/patch-settings) endpoint:

```bash cURL theme={null}
curl --request PATCH \
  --url 'https://<your-domain>/api/v2/tenants/settings' \
  --header 'Authorization: Bearer MGMT_API_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{\
    "session_lifetime": SESSION_LIFETIME_VALUE,\
    "idle_session_lifetime": IDLE_SESSION_LIFETIME_VALUE,\
    "ephemeral_session_lifetime": EPHEMERAL_SESSION_LIFETIME_VALUE,\
    "idle_ephemeral_session_lifetime": EPHEMERAL_IDLE_SESSION_LIFETIME_VALUE\
  }'
```

<table class="table">
  <thead>
    <tr>
      <th><strong>Parameter</strong></th>
      <th><strong>Description</strong></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>session\_lifetime</code></td>
      <td>Maximum duration (in hours) for absolute timeout.</td>
    </tr>

    <tr>
      <td><code>idle\_session\_lifetime</code></td>
      <td>Maximum duration (in hours) before a session expires due to inactivity.</td>
    </tr>

    <tr>
      <td><code>ephemeral\_session\_lifetime</code></td>
      <td>Maximum duration (in hours) for absolute timeout.</td>
    </tr>

    <tr>
      <td><code>idle\_ephemeral\_session\_lifetime</code></td>
      <td>Maximum duration (in hours) before a session expires due to inactivity.</td>
    </tr>
  </tbody>
</table>

## Auth0 Post-Login Actions

You can configure session behavior dynamically using `api.session` methods with a [post-login Action](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger). This allows you to override default tenant session settings on a per-login basis, based on user or context-specific logic.

Use cases include:

* Shortening timeouts for high-risk logins

* Extending timeouts for trusted users or organizations

* Adjusting cookie persistence based on application type

The `api.session` methods available to configure session lifetimes are:

* `api.session.setExpiresAt`

* `api.session.setIdleExpiresAt`

* `api.session.setCookieMode`

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  The `api.session` methods only apply to the current session and must be called during the login transaction. These methods require that the event property `event.session.id` is available.
</Callout>

To learn more, read [Sessions with Actions](/docs/manage-users/sessions/manage-sessions-actions).
