Skip to content

GcsSessionPersistence

SessionPersistenceInterface storing one JSON object per session id (object <prefix><sid>.json) in a single GCS bucket.

The storage behaviour is ObjectStoreSessionPersistence, shared with the other object-store session backends; this class supplies the client.

final class GcsSessionPersistence extends ObjectStoreSessionPersistence

ExtendsObjectStoreSessionPersistence
SourceGcsSessionPersistence.php

public function __construct(ObjectStoreClientInterface $client, string $objectPrefix = 'sessions/', SessionCodecInterface $codec = null): mixed

Defaults to the portable codec: for an object store the round-trip dominates, and a readable stored object is worth more than a compact one.

ParameterTypeDescription
$clientObjectStoreClientInterfaceThe store, already bound to its bucket or container.
$objectPrefixstring
$codecSessionCodecInterfaceDefaults to the portable codec: for an object store the round-trip dominates, and a readable stored object is worth more than a compact one.

Returns mixed

These come from an ancestor and are documented where they are declared.

MethodDeclared inDescription
delete()ObjectStoreSessionPersistenceDeletes the session’s object from the store.
load()ObjectStoreSessionPersistenceFetches the session’s object from the store and decodes it.
save()ObjectStoreSessionPersistence