> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-feat-sdk-reference-docs.mintlify.site/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:

| Session Policy | Description |
| - | - |
| **Idle Session Lifetime (Persistent)** | Maximum time (in minutes) of inactivity before a persistent session expires. |
| **Idle Session Lifetime (Non-Persistent)** | Maximum time (in minutes) of inactivity before a non-persistent session expires. |
| **Maximum Session Lifetime (Persistent)** | Maximum time (in minutes) a persistent session can exist, even if the user is active. |
| **Maximum Session Lifetime (Non-Persistent)** | Maximum time (in minutes) a non persistent session can exist, even if the user is active. |

<Frame>
  <img src="https://mintcdn.com/docs-dev-feat-sdk-reference-docs/8mFNllJO8zv9wchk/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?fit=max&auto=format&n=8mFNllJO8zv9wchk&q=85&s=809a5f7971c746f568669c518aa1459e" 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/docs-dev-feat-sdk-reference-docs/8mFNllJO8zv9wchk/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?w=280&fit=max&auto=format&n=8mFNllJO8zv9wchk&q=85&s=869d7e975e794965eed8a05e2f2ebb0d 280w, https://mintcdn.com/docs-dev-feat-sdk-reference-docs/8mFNllJO8zv9wchk/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?w=560&fit=max&auto=format&n=8mFNllJO8zv9wchk&q=85&s=5161d7b2ff8ad8c96c1cf48a2b44a1c6 560w, https://mintcdn.com/docs-dev-feat-sdk-reference-docs/8mFNllJO8zv9wchk/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?w=840&fit=max&auto=format&n=8mFNllJO8zv9wchk&q=85&s=5761a5c633237959ff41e1139020e3c5 840w, https://mintcdn.com/docs-dev-feat-sdk-reference-docs/8mFNllJO8zv9wchk/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?w=1100&fit=max&auto=format&n=8mFNllJO8zv9wchk&q=85&s=e32959e40fd4c7d373e94638a9edc583 1100w, https://mintcdn.com/docs-dev-feat-sdk-reference-docs/8mFNllJO8zv9wchk/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?w=1650&fit=max&auto=format&n=8mFNllJO8zv9wchk&q=85&s=7d65e4f88e12952a1c136d61182c026f 1650w, https://mintcdn.com/docs-dev-feat-sdk-reference-docs/8mFNllJO8zv9wchk/docs/images/cdy7uua7fh8z/session-lifetime/Dashboard-Tenant-Settings-Advanced-Session-expiration.png?w=2500&fit=max&auto=format&n=8mFNllJO8zv9wchk&q=85&s=982559a3e226b617c99e51d72dae33dd 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:

<Tabs>
  <Tab title="Auth0 CLI">
    <Callout icon="file-lines" color="#0EA5E9" iconType="regular">Using the Auth0 CLI? If you haven't already, [set up and authenticate your CLI session](/docs/deploy-monitor/auth0-cli) before running this command.</Callout>

    ```bash theme={null}
    auth0 api patch "tenants/settings" \
      --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   }'
    ```
  </Tab>

  <Tab title="cURL">
    ```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\
      }'
    ```
  </Tab>
</Tabs>

| Parameter | Description |
| - | - |
| `session_lifetime` | Maximum duration (in hours) for absolute timeout. |
| `idle_session_lifetime` | Maximum duration (in hours) before a session expires due to inactivity. |
| `ephemeral_session_lifetime` | Maximum duration (in hours) for absolute timeout. |
| `idle_ephemeral_session_lifetime` | Maximum duration (in hours) before a session expires due to inactivity. |

## 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).
