ciaranj / express-session-mongodb

MongoDB backed sessions for the expressjs.com framework
11 stars 2 forks source link

new express #4

Open ghost opened 14 years ago

ghost commented 14 years ago

Hi, I have recently changed my app to use the new express version, however as I was using this as a plugin. As it is using connect middleware now I am not sure how the file needs to be adjusted to work on the new express. Can this be adjusted to accommodate the new code easily?

ciaranj commented 14 years ago

I was planning on porting it,but I saw a while ago that this had come out : http://gist.github.com/503680 ... Is this suitable for your needs ? ..otherwise then yeah it would be easy to port mine across.

ghost commented 14 years ago

Not getting very far with this gist It is not writing the session. I use var MongoDbStore = require('./vendor/rick_mongo'); Then I called app.use(connect.session({ store: new MongoDbStore({dbname: "session_pooped", port: 27018 }) })); and it creates the Db but not the collection which is defaulting to Session, then when I read a session it shows the last access? So I guess it is storing it somewhere. Anyway I got confused trying to get it to work, and I have reverted to using connect Memory Store (for now). I really liked what you had for the express plugin as I got all that working fine before, but I am not smart enough to know how to alter it for the new express since I upgraded. IF you are able to just tweek your express-session-mongodb form a plugin extension to the new express/connect system, and it is easy for you to do (that is), that would be awsome.