Default in-memory session store. Simple Map — state is lost when the process restarts. Suitable for single-process applications and testing.
const redisStore: SessionStore = { async get(key) { const raw = await redis.get(`ompx:session:${key}`) return raw ? JSON.parse(raw) : undefined }, async set(key, entry) { await redis.set(`ompx:session:${key}`, JSON.stringify(entry)) }, async delete(key) { await redis.del(`ompx:session:${key}`) },} Copy
const redisStore: SessionStore = { async get(key) { const raw = await redis.get(`ompx:session:${key}`) return raw ? JSON.parse(raw) : undefined }, async set(key, entry) { await redis.set(`ompx:session:${key}`, JSON.stringify(entry)) }, async delete(key) { await redis.del(`ompx:session:${key}`) },}
Returns the number of active sessions (for testing/debugging)
Default in-memory session store. Simple Map — state is lost when the process restarts. Suitable for single-process applications and testing.
Example: Inject a custom Redis-backed store