final class SessionConfigDefinition extends AbstractConfigDefinition (View source)

Builds declarative session configuration entries for application config sources

Properties

protected mixed[] $data from  AbstractConfigDefinition

Methods

set(string $path, mixed $value)

Replaces one configuration value at a dot-separated path.

append(string $path, mixed $value)

Appends one configuration value at a dot-separated list path.

create()

Starts an empty session configuration contribution

Creates the framework's canonical default session configuration contribution.

static SessionConfig

Resolves the framework's canonical default contribution into runtime configuration.

static string

Returns the stable config module key consumed by the session provider

string
driver(string $driver)

Selects the storage driver used for session persistence

cookieName(string $cookie)

Sets the browser cookie name that carries the session identifier

cookieSameSite(SessionCookieSameSite $sameSite)

Sets the browser cross-site delivery policy for the session cookie.

cookieSecure(SessionCookieSecure $secure)

Selects whether Secure follows the verified request scheme or is always enabled.

lifetime(int $seconds)

Sets the shared cookie and storage retention period in seconds

nativePath(string $path)

Sets the writable storage path used by native PHP sessions

filePath(string $path)

Sets the writable storage path used by file-backed sessions

databaseTable(string $table)

Sets the database table used by database-backed sessions

redisHost(string $host)

Sets the Redis host used by Redis-backed sessions

redisPort(int $port)

Sets the Redis TCP port used by Redis-backed sessions

redisDatabase(int $database)

Sets the Redis logical database used by Redis-backed sessions

redisPassword(string|null $password)

Sets the optional Redis authentication secret

redisPrefix(string $prefix)

Sets the namespace prefix applied to Redis session keys

redisTimeout(float|int $seconds)

Sets the connection timeout for Redis-backed sessions in seconds

Applies this raw configuration contribution to an already resolved session configuration.

Details

toArray

No description

Return Value

array

fromArrayData

final static AbstractConfigDefinition fromArrayData(array $data)

No description

Parameters

array $data

Return Value

AbstractConfigDefinition

set

protected AbstractConfigDefinition set(string $path, mixed $value)

Replaces one configuration value at a dot-separated path.

Parameters

string $path
mixed $value

Return Value

AbstractConfigDefinition

append

protected AbstractConfigDefinition append(string $path, mixed $value)

Appends one configuration value at a dot-separated list path.

Parameters

string $path
mixed $value

Return Value

AbstractConfigDefinition

create

Starts an empty session configuration contribution

defaults

Creates the framework's canonical default session configuration contribution.

resolvedDefaults

static SessionConfig resolvedDefaults()

Resolves the framework's canonical default contribution into runtime configuration.

Return Value

SessionConfig

moduleKey

static string moduleKey()

Returns the stable config module key consumed by the session provider

Return Value

string

driver

SessionConfigDefinition driver(string $driver)

Selects the storage driver used for session persistence

Parameters

string $driver

Return Value

SessionConfigDefinition

cookieName

SessionConfigDefinition cookieName(string $cookie)

Sets the browser cookie name that carries the session identifier

Parameters

string $cookie

Return Value

SessionConfigDefinition

cookieSameSite

SessionConfigDefinition cookieSameSite(SessionCookieSameSite $sameSite)

Sets the browser cross-site delivery policy for the session cookie.

Parameters

SessionCookieSameSite $sameSite

Return Value

SessionConfigDefinition

cookieSecure

SessionConfigDefinition cookieSecure(SessionCookieSecure $secure)

Selects whether Secure follows the verified request scheme or is always enabled.

Parameters

SessionCookieSecure $secure

Return Value

SessionConfigDefinition

lifetime

SessionConfigDefinition lifetime(int $seconds)

Sets the shared cookie and storage retention period in seconds

Parameters

int $seconds

Return Value

SessionConfigDefinition

nativePath

SessionConfigDefinition nativePath(string $path)

Sets the writable storage path used by native PHP sessions

Parameters

string $path

Return Value

SessionConfigDefinition

filePath

SessionConfigDefinition filePath(string $path)

Sets the writable storage path used by file-backed sessions

Parameters

string $path

Return Value

SessionConfigDefinition

databaseTable

SessionConfigDefinition databaseTable(string $table)

Sets the database table used by database-backed sessions

Parameters

string $table

Return Value

SessionConfigDefinition

redisHost

SessionConfigDefinition redisHost(string $host)

Sets the Redis host used by Redis-backed sessions

Parameters

string $host

Return Value

SessionConfigDefinition

redisPort

SessionConfigDefinition redisPort(int $port)

Sets the Redis TCP port used by Redis-backed sessions

Parameters

int $port

Return Value

SessionConfigDefinition

redisDatabase

SessionConfigDefinition redisDatabase(int $database)

Sets the Redis logical database used by Redis-backed sessions

Parameters

int $database

Return Value

SessionConfigDefinition

redisPassword

SessionConfigDefinition redisPassword(string|null $password)

Sets the optional Redis authentication secret

Parameters

string|null $password

Return Value

SessionConfigDefinition

redisPrefix

SessionConfigDefinition redisPrefix(string $prefix)

Sets the namespace prefix applied to Redis session keys

Parameters

string $prefix

Return Value

SessionConfigDefinition

redisTimeout

SessionConfigDefinition redisTimeout(float|int $seconds)

Sets the connection timeout for Redis-backed sessions in seconds

Parameters

float|int $seconds

Return Value

SessionConfigDefinition

applyTo

Applies this raw configuration contribution to an already resolved session configuration.

Missing fields preserve their current values, while an explicitly configured Redis password may clear it.

Parameters

SessionConfig $current

Return Value

SessionConfig