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.
Synopsis
Section titled “Synopsis”final class GcsSessionFactory implements SessionFactoryInterface
| Implements | SessionFactoryInterface |
| Since | 3.0.0 |
| Source | GcsSessionFactory.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
createPersistence(Context $context, array<string, mixed> $parameters): SessionPersistenceInterface | Builds GCS-backed session persistence from the slot’s parameters. |
createPersistence()
Section titled “createPersistence()”public function createPersistence(Context $context, array<string, mixed> $parameters): SessionPersistenceInterface
Builds GCS-backed session persistence from the slot’s parameters.
| Parameter | Type | Description |
|---|---|---|
$context | Context | |
$parameters | array``<``string``, ``mixed``> |
Returns SessionPersistenceInterface
| Throws | When |
|---|---|
RuntimeException | If no PSR-18 client is bound in the container. |