session icon indicating copy to clipboard operation
session copied to clipboard

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

Open dwhieb opened this issue 9 years ago • 4 comments
trafficstars

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:

  • regenerate()
  • load()
  • createSession()

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.

dwhieb avatar Aug 30 '16 04:08 dwhieb

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 :)!

dougwilson avatar Aug 30 '16 04:08 dougwilson

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).

dwhieb avatar Aug 30 '16 04:08 dwhieb

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 :)

dougwilson avatar Aug 30 '16 04:08 dougwilson

Any news about this issue?

demurgos avatar May 20 '17 12:05 demurgos