Advanced session store for Redis supporting multiple apps, token-based sessions, activity tracking, and optional in-memory caching. Current stable version 4.0.0 (2025) uses async/await (breaking from v3 callbacks). Provides create, get, set, kill, killall, activity, soid, killsoid, soapp methods. Ships TypeScript types. Designed for cross-platform session sharing via REST (rest-sessions) or Express (connect-redis-sessions), both currently incompatible with v4.0.0. Performance: 1000 creates in ~140ms, 1000 gets in ~90ms on 2018 MacBook Pro. Engine requirement: Node >=16.
npm install redis-sessionsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes redis-sessions client, creates a session, gets it, sets custom data, kills it, and checks activity count.
Replace callbacks with async/await or use .then().
Stay on v3.x for Express integration, or wait for updated packages.
Update calls to match new async signatures. See migration guide.
Upgrade Node to 16+.
Use cachetime appropriately; avoid relying on idle/r for precise tracking if caching enabled.
Use import statement: import RedisSessions from 'redis-sessions'
Provide an id field: rs.create({ app: 'myapp', id: 'user123' })Provide the token returned from create(): rs.get({ app: 'myapp', token })Start Redis server or configure host/port correctly: new RedisSessions({ host: '192.168.0.20', port: 6379 })