class SessionConfig

How long sessions and the tokens behind them last.

Every value here is answered the same way: `config.php` first, then the settings table, then the default that has always applied. Putting a value in `config.php` is therefore also a way to take it away from the admin panel — a site owner can pin session lengths where an administrator cannot loosen them, which is the point of keeping the option in a file rather than only in the database.

Constants

DEFAULT_LIFETIME

How long a session may sit idle before it is discarded, in minutes.

Methods

__construct( Config $config, SettingsRepositoryInterface $settings)

No description

int|null
tokenLifetime(string $type)

How long tokens of the given type stay valid, in seconds, or `null` to leave the decision to the token class.

int
lifetime()

How long a session may sit idle before it is discarded, in minutes.

bool
cookieExpiresOnClose()

Whether session cookies should be discarded when the browser closes.

bool
configOverride()

Whether any of this is pinned in `config.php`, and so cannot be changed from the admin panel.

Details

__construct( Config $config, SettingsRepositoryInterface $settings)

Parameters

Config $config
SettingsRepositoryInterface $settings

int|null tokenLifetime(string $type)

How long tokens of the given type stay valid, in seconds, or `null` to leave the decision to the token class.

Zero is a real answer rather than an absent one — it means the token never expires — so it has to survive the fall through the sources below.

Parameters

string $type

Return Value

int|null

int lifetime()

How long a session may sit idle before it is discarded, in minutes.

Return Value

int

bool cookieExpiresOnClose()

Whether session cookies should be discarded when the browser closes.

This is about the cookie, not the token behind it: the session remains valid server-side for its lifetime, but the browser stops presenting it once the window is gone. Shared computers are the usual reason to want it.

Return Value

bool

bool configOverride()

Whether any of this is pinned in `config.php`, and so cannot be changed from the admin panel.

Return Value

bool