Skip to content

GcsSessionFactory

session slot factory for GcsSessionPersistence.

yaml session: class: Quiote\Storage\Gcs\GcsSessionFactory params: bucket: my-app-sessions access_key: '%env(GCS_HMAC_ACCESS_KEY)%' secret_key: '%env(GCS_HMAC_SECRET)%' object_prefix: 'sessions/'

The %env(NAME)% credentials are read from the process environment when the compiled configuration is loaded, not when it is compiled, so no key is written into the config cache — see EnvPlaceholder.

Uses GCS’s S3-compatible HMAC interoperability API, so the credentials are an HMAC key pair rather than a service-account JSON file. Bring your own PSR-18 client, bound in the container.

final class GcsSessionFactory implements SessionFactoryInterface

ImplementsSessionFactoryInterface
Since3.0.0
SourceGcsSessionFactory.php
MethodDescription
createPersistence(Context $context, array<string, mixed> $parameters): SessionPersistenceInterfaceBuilds GCS-backed session persistence from the slot’s parameters.

public function createPersistence(Context $context, array<string, mixed> $parameters): SessionPersistenceInterface

Builds GCS-backed session persistence from the slot’s parameters.

ParameterTypeDescription
$contextContext
$parametersarray``<``string``, ``mixed``>

Returns SessionPersistenceInterface

ThrowsWhen
RuntimeExceptionIf no PSR-18 client is bound in the container.