expressjs / session

Simple session middleware for Express
MIT License
6.21k stars 972 forks source link

update Readme to include details on extending Store implementation from store.js #349

Open dwhieb opened 7 years ago

dwhieb commented 7 years ago

As noted in a comment on #97, developers who want to write a Store implementation either need to:

  1. extend their Store from express-session's store.js, which typically means requiring express-session as a dependency
  2. implement their own version of the functionality in store.js, session.js, and cookie.js (or copy the files from express-session)

This is because express-session requires the following methods on the Store in order to work:

These are available in store.js, but createSession itself requires both session.js and cookie.js.

The documentation should be updated to provide guidance on these facts.

dougwilson commented 7 years ago

I'm reading back up on that discussion (sorry that is an old thread) and as far as I can tell, it specifically says not to do what you suggested as number 1. Would you be willing to put together a PR to help improve our documentation :)? I'm sure it does need improving, though that doesn't seem to slow down the rate at which new stores are being implemented, haha.

It looks like that issue was closed in Nov 2014, and them some additional (good) comments went on again in Feb 2015, but that was months later and instead of opening a new issue, the comments were just lots. Thanks for opening a new issue so we can finally not loose this conversation :)!

dwhieb commented 7 years ago

Sure! I'll make a PR soon. Since I just recently used the docs to write my own Store, it's all fresh to me, and I can target places I had hang-ups (really just this one place).

dougwilson commented 7 years ago

Great!

Since I just recently used the docs to write my own Store, it's all fresh to me, and I can target places I had hang-ups (really just this one place).

This is the most valuable reason to get docs from folks; I can definitely get around to adding to the docs at some point, but usually the docs end up not being great because you just don't always think of everything when you already know about it. I love these kind of doc contributions :)

demurgos commented 7 years ago

Any news about this issue?