Description
As explained in #349, developers who want to write their own Store implementation for express-session face one of two choices:
- include express-session as a dependency and extend their Store from store.js
- reimplement the functionality of store.js, session.js, and cookie.js (or copy the files from express-session, which amounts to including it as a dependency, but without the benefit of avoiding redundant code)
For many people (myself included), I expect neither of these options is appealing. So instead of requiring the Store implementation to include .createSession(), .load(), and .regenerate(), I suggest that these methods be added to the Store object by express-session on initialization, similar to the way that .generate() is added to the Store here. Couldn't .createSession(), .load(), and .regenerate() be added to the Store in the same way?
These methods could either be moved to index.js like .generate(), or generate() could be moved to store.js, and the methods in store.js could be added to the Store on initialization.
I'm happy to create a PR if this is an improvement you'd like to see implemented.