> For the complete documentation index, see [llms.txt](https://docs.cybus.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cybus.io/2-6-1/access/user-management/users/user-session-expiration.md).

# User Session Expiration

Configure how long user sessions remain valid before re-authentication is required.

By default, a user stays signed in for 12 hours. When a session is close to expiring, the Admin UI shows a ten-minute countdown in the top right corner and warns the user, who must then sign in again.

## Session Expiration Parameters

You can set the session expiration time through the following parameters. The parameter differs between Kubernetes and Docker deployments.

{% tabs %}
{% tab title="Kubernetes Parameters" %}

## Kubernetes Parameter

| Parameter                                | Description                                                                                                                                                                                                                                                                                                                                       | Default |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `global.authentication.tokenExpiryHours` | <p>Defines how long (in hours) a user stays signed in before being logged out for security reasons. After the configured time has passed, the user session expires and a new login is required.<br><br>The Admin UI displays a ten-minute countdown in the top right corner, and users receive a warning ten minutes before the session ends.</p> | `12`    |
| {% endtab %}                             |                                                                                                                                                                                                                                                                                                                                                   |         |

{% tab title="Docker Parameters" %}

## Docker Parameter

| Parameter                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Default |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `CYBUS_AUTH_TOKEN_EXPIRE_TIME_IN_HOURS` | <p>Defines how long (in hours) a user stays signed in before being logged out for security reasons. After the configured time has passed, the user session expires and a new login is required.<br><br>The Admin UI displays a ten-minute countdown in the top right corner, and users receive a warning ten minutes before the session ends. If the variable is not set, or if the value is negative or not a valid number, the system uses the default duration of 12 hours.</p> | `12`    |
| {% endtab %}                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |         |
| {% endtabs %}                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |         |

## Setting the Session Expiration Time

You can adjust the session duration by modifying the corresponding parameter for your deployment.

{% tabs %}
{% tab title="Kubernetes" %}

## Changing the Session Expiration Time (Kubernetes)

1. Open the `values.yaml` file.
2. Set the `global.authentication.tokenExpiryHours` Helm value to the desired number of hours.

{% code lineNumbers="true" %}

```yaml
global:
  authentication:
    tokenExpiryHours: 8
```

{% endcode %}

3. Upgrade your Helm chart to apply the Helm configuration changes. For details, see [Applying Helm Configuration Changes](/2-6-1/cybus-helm-charts/working-with-cybus-helm-charts.md#applying-helm-configuration-changes).
   {% endtab %}

{% tab title="Docker" %}

## Changing the Session Expiration Time (Docker)

If the configured value is invalid (for example, negative or not a valid number), the system reverts to the default duration of 12 hours.

1. Navigate to your Connectware installation directory. The default installation directory is `/opt/connectware`.
2. Open the `docker-compose.yml` file.
3. In the `environment:` section, set the `CYBUS_AUTH_TOKEN_EXPIRE_TIME_IN_HOURS` environment variable to the desired number of hours.

{% code lineNumbers="true" %}

```yaml
environment:
  - CYBUS_AUTH_TOKEN_EXPIRE_TIME_IN_HOURS=8
```

{% endcode %}

4. Start or restart Connectware. For details, see [Restarting Connectware](/2-6-1/deployment/restarting-connectware.md).
   {% endtab %}
   {% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cybus.io/2-6-1/access/user-management/users/user-session-expiration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
