OMPX JavaScript SDK
    Preparing search index...

    Class InMemorySessionStore

    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}`) },
    }

    Implements

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get size(): number

      Returns the number of active sessions (for testing/debugging)

      Returns number

    Methods