express-session-mongo icon indicating copy to clipboard operation
express-session-mongo copied to clipboard

Only store a session with its own properties

Open bartt opened this issue 14 years ago • 1 comments

Dav,

you're storing a session as is in Mongo. Including the req attribute and the session's proto. When you read this back from Mongo it does overwrite the touch() function in the Session's prototype. This in turn breaks connect's session middleware.

I tested this with [email protected] and [email protected].

bartt avatar Nov 16 '10 08:11 bartt

Dav, a had to make a bunch more changes. BSONNative has a problem with Long.toNumber() which forced me to switch to BSONPure. I also figured out how to rename a repository on github and went ahead to rename it to connect-session-mongo.

Feel free to pull the changes if you like. I'd like to avoid having both express-session-mongo and connect-session-mongo around and gladly support a single connect-session-mongo if you're willing to rename davglass/express-session-mongo to davglass/connect-session-mongo. I have no intention of stealing your thunder.

bartt avatar Nov 16 '10 20:11 bartt