2020-02-29 00:43:59 +00:00
|
|
|
---
|
|
|
|
layout: default
|
|
|
|
title: Session
|
|
|
|
parent: Configuration
|
2020-04-30 02:03:05 +00:00
|
|
|
nav_order: 10
|
2020-02-29 00:43:59 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Session
|
|
|
|
|
|
|
|
**Authelia** relies on session cookies to authenticate users. When the user visits
|
|
|
|
a website of the protected domain `example.com` for the first time, Authelia detects
|
|
|
|
that there is no cookie for that user. Consequently, Authelia redirects the user
|
|
|
|
to the login portal through which the user should authenticate to get a cookie which
|
|
|
|
is valid for `*.example.com`, meaning all websites of the domain.
|
|
|
|
At the next request, Authelia receives the cookie associated to the authenticated user
|
|
|
|
and can then order the reverse proxy to let the request pass through to the application.
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
session:
|
|
|
|
# The name of the session cookie. (default: authelia_session).
|
|
|
|
name: authelia_session
|
|
|
|
|
|
|
|
# The secret to encrypt the session cookie.
|
2020-04-23 01:11:32 +00:00
|
|
|
# Secret can also be set using a secret: https://docs.authelia.com/configuration/secrets.html
|
2020-02-29 00:43:59 +00:00
|
|
|
secret: unsecure_session_secret
|
|
|
|
|
|
|
|
# The time in seconds before the cookie expires and session is reset.
|
2020-04-05 12:37:21 +00:00
|
|
|
expiration: 1h
|
2020-02-29 00:43:59 +00:00
|
|
|
|
|
|
|
# The inactivity time in seconds before the session is reset.
|
2020-04-05 12:37:21 +00:00
|
|
|
inactivity: 5m
|
2020-02-29 00:43:59 +00:00
|
|
|
|
2020-04-03 23:11:33 +00:00
|
|
|
# The remember me duration.
|
|
|
|
# Value of 0 disables remember me.
|
2020-04-05 12:37:21 +00:00
|
|
|
# Value is in seconds, or duration notation. See: https://docs.authelia.com/configuration/index.html#duration-notation-format
|
2020-04-03 23:11:33 +00:00
|
|
|
# Longer periods are considered less secure because a stolen cookie will last longer giving attackers more time to spy
|
|
|
|
# or attack. Currently the default is 1M or 1 month.
|
|
|
|
remember_me_duration: 1M
|
|
|
|
|
2020-02-29 00:43:59 +00:00
|
|
|
# The domain to protect.
|
|
|
|
# Note: the login portal must also be a subdomain of that domain.
|
|
|
|
domain: example.com
|
|
|
|
|
|
|
|
# The redis connection details (optional)
|
|
|
|
# If not provided, sessions will be stored in memory
|
|
|
|
redis:
|
|
|
|
host: 127.0.0.1
|
|
|
|
port: 6379
|
2020-04-23 01:11:32 +00:00
|
|
|
# Password can also be set using a secret: https://docs.authelia.com/configuration/secrets.html
|
2020-02-29 00:43:59 +00:00
|
|
|
password: authelia
|
2020-04-03 23:11:33 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Security
|
|
|
|
|
|
|
|
Configuration of this section has an impact on security. You should read notes in
|
|
|
|
[security measures](../security/measures.md#session-security) for more information.
|
|
|
|
|
2020-04-05 12:37:21 +00:00
|
|
|
### Duration Notation
|
2020-04-03 23:11:33 +00:00
|
|
|
|
2020-04-05 12:37:21 +00:00
|
|
|
The configuration parameters expiration, inactivity, and remember_me_duration use duration notation. See the documentation
|
|
|
|
for [duration notation format](index.md#duration-notation-format) for more information.
|