The KV namespace binding
Wall clock; pass IRuntimeServices
Optionaloptions: KvSessionStoreOptions
Key prefix
Removes a stored session.
Session identifier
true when an entry was removed
Reads a stored session payload.
Session identifier
The payload, or null when absent or expired
Writes a session payload, replacing any existing one.
Session identifier
The payload to persist
Time-to-live in milliseconds from now
A session store backed by Workers KV.
Constructed by the application and handed to
SessionPlugin, not registered byCloudflarePlugin:SessionPluginOptions.storeis read when the plugin is constructed, which is before any application exists, so a store published in the service registry could never reach it.KV's eventual consistency applies. A
destroy()propagates within seconds rather than instantly, which is still strictly better than the cookie strategy, where a stolen cookie stays valid untilmaxAge.Example
Since
0.2.0