1602 / jugglingdb

Multi-database ORM for nodejs: redis, mongodb, mysql, sqlite3, postgresql, arango, in-memory...
http://1602.github.io/jugglingdb/
2.05k stars 241 forks source link

connect session is stored as [object Object] with jugglingdb@0.2.11 #366

Open avalez opened 10 years ago

avalez commented 10 years ago

Hi,

Storing session in db as described here https://npmjs.org/package/connect-jugglingdb is broken with the following error:

TypeError: Cannot read property 'expires' of undefined at /app/node_modules/connect-jugglingdb/index.js:81:5

Cause: psql> select * from sessions => id sid expires session 4 lDWyP5LEZpl7iDw9zmqLClF8 2014-02-13 22:24:16 [object Object]

The problem does not occur with jugglingdb@0.2.5

Thank you.

anatoliychakkaev commented 10 years ago

How is that possible? https://github.com/jugglingdb/connect-jugglingdb/blob/master/index.js#L81 This code checking that session is not undefined, and then it says that session is not defined. Maybe npm has outdated package published? Have you tried to install from connect-jugglingdb github? Anyway it looks like an issue of https://github.com/jugglingdb/connect-jugglingdb

On Thu, Jan 30, 2014 at 4:36 PM, Andriy Zhdanov notifications@github.comwrote:

Hi,

Storing session in db as described here https://npmjs.org/package/connect-jugglingdb is broken with the following error:

TypeError: Cannot read property 'expires' of undefined at /app/node_modules/connect-jugglingdb/index.js:81:5

Cause: psql> select * from sessions => id sid expires session 4 lDWyP5LEZpl7iDw9zmqLClF8 2014-02-13 22:24:16 [object Object]

The problem does not occur with jugglingdb@0.2.5

Thank you.

Reply to this email directly or view it on GitHubhttps://github.com/1602/jugglingdb/issues/366 .

avalez commented 10 years ago

Hi Anatoliy,

I'm not sure how is it possible, but as I've mentioned, problem does not occur with jugglingdb@0.2.5

I've initially wanted to submit the bug to connect-jugglingdb, but then figured out that jugglinbdb@0.2.11 has this problem and 0.2.5 does not. And connect-jugglindb is the same 0.0.3

avalez commented 10 years ago

Sorry, correct error is:

TypeError: Cannot read property 'expires' of undefined /app/node_modules/connect/lib/middleware/session/store.js:77

avalez commented 10 years ago

And at the code you've pointed, I think session.session is undefined, though it must be "[object Object]" which is the problem I think.