Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with koa-redis? #204

Open
knpwrs opened this issue Nov 28, 2020 · 1 comment
Open

Compatibility with koa-redis? #204

knpwrs opened this issue Nov 28, 2020 · 1 comment

Comments

@knpwrs
Copy link

knpwrs commented Nov 28, 2020

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?

@knpwrs
Copy link
Author

knpwrs commented Nov 28, 2020

It seems like a number of things are in limbo right now:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant