How to configure User Session Timeout

The User Session Timeout policy enables you to define a maximum idle time, ensuring that sessions are automatically terminated after a period of inactivity. It also allows you to define a maximum session time to avoid sessions staying open indefinitely.

This guide walks you through configuring the User Session Timeout policy.

Go to User Session Timeout reference

Configuring a user session timeout

  1. Run the following GET request in your terminal to obtain the current values for the User Session Timeout in your account.
Terminal window
curl --request GET \
--url https://api.azion.com/v4/auth/policies/session \
--header 'Accept: application/json' \
--header 'Authorization: 123'
  1. You’ll receive a response similar to this:
Terminal window
{
"data": {
"max_idle_time": 1,
"max_session_time": 5
}

This means the policy is configured with 1 minute for the maximum idle time and 5 minutes for the maximum session time.

  1. Run the following PUT request in your terminal to update the values for the User Session Timeout in your account.
Terminal window
curl --request PUT \
--url https://api.azion.com/v4/auth/policies/session \
--header 'Accept: application/json' \
--header 'Authorization: 123' \
--header 'Content-Type: application/json' \
--data '{
"max_idle_time": 1,
"max_session_time": 5
}'

Where:

KeyTypeDescription
max_idle_timeIntegerDefines the period of inactivity after which a session is automatically terminated. The value must be in minutes. Default value and maximum idle time allowed: 1440, equivalent to 1 day
max_session_timeIntegerDefines the total time a session can remain active, regardless of activity, ensuring sessions don’t stay open indefinitely. The value must be in minutes, between 5 minutes and 21600 minutes, equivalent to 15 days. Default value: 21600
  1. You’ll receive a response similar to this:
Terminal window
{
"state": "executed",
"data": {
"max_idle_time": 1,
"max_session_time": 5
}

Done. The User Session Timeout is now configured with the new values.


Contributors