Skip to content

Compatibility with koa-redis? #204

@knpwrs

Description

@knpwrs

I've gotten myself confused about how to properly manage sessions with redis and koa:

  • There are two projects, koa-session and koa-generic-session. They are both recently updated and neither mentions the other.
  • The README for koa-session does not recommend any external session stores, the README for koa-generic-session mentions koa-redis.
  • When attempting to use @types/koa-generic-session, @types/koa-session, and @types/koa-redis it appears that koa-redis IS compatible with koa-session, but IS NOT compatible with koa-generic-session.
  • The README for koa-session specifies that a store should have get(key, maxAge, { rolling, ctx }), but koa-redis has get(key) (no second or third parameters).
  • The README for koa-session specifies that a store should have set(key, sess, maxAge, { rolling, changed, ctx }), koa-redis has set(sid, sess, ttl) (no fourth parameter).
  • The README for koa-session specifies that a store should have destroy(key, {ctx}). koa-redis has destroy(sid) (no second parameter).
  • Upon initial trial, it appears (on the surface) that koa-session works with koa-redis, though I fear this may be a coincidence.

Are the typings incorrect? Is koa-redis only meant to be used with koa-generic-session? Or can koa-redis be used with koa-session? What is the recommended method for managing sessions with koa and redis?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions