Middleware for Koa2 to get/set session with custom stores like Redis or MongoDB. Current stable version is 2.2.10, with infrequent releases. Uses native ES6 async/await (Node >=7.6.0). Supports custom store classes (extending Store) and session refresh. Less active than koa-session but offers a simpler Store interface.
npm install koa-session2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic session middleware setup with a view counter example.
Implement methods with correct signature: get(sid, ctx), set(session, { sid, maxAge }, ctx), destroy(sid, ctx)Migrate to koa-session (koa-session) or @koa/session
Upgrade Node.js to >=7.6.0 or use older version from babel/node6 branches
Use a custom store like RedisStore as shown in README
Upgrade Node to >=7.6.0 or use babel polyfill
Use const session = require('koa-session2');Check export: module.exports = RedisStore; or use { Store } from 'koa-session2'