expressjs/session — pull request #27 by ricardofbarros (2014-04-22 17:14:05+00:00)
Title: Removing dependency with cookieParser module

Sorry for the repost, but I'm new in github.

Right now to enable sessions you need to do something like this:

app.use(cookieParser());
app.use(session(opt));

I got two strong arguments.

First, I think this isn't the "right way" to do things, If you want session enabled in your express app you will need to have basically two modules cookieParser and session, shouldn't session be "independent" as a module block ?

Second, having this two modules installed leads to have cookie and cookie-parser duplicated in the dependencies of these modules (node_modules).

The solution should be a "merge" of cookieParser and session, something like I have done, and so the session module becomes truly independent of cookieParser and you can enable sessions in express app like this:

app.use(session(opt));