ciaranj / express-session-mongodb

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

Id cannot be longer than 12 bytes #2

Open weepy opened 14 years ago

weepy commented 14 years ago

I get the this error when I'm trying to use this ?

Id cannot be longer than 12 bytes

I guess it's because express's session id's are 28 bytes long when in hex ?

ciaranj commented 14 years ago

Thats pretty weird, is this out of the box ? ... Thats caused when an id string isn't converted to the ObjectId before persisting it back to mongo, perhaps this is an incompatibility with a newer version of express :( .. What version are you using ?

weepy commented 14 years ago

^_^ yes all out the box, edge express, node 0.1.98.

ciaranj commented 14 years ago

hmm, I've not tested it with express more recent than express 0.8.0 ... I'll try and take a look later, but its strange as the session id used to be mongodb's own ids ... I guess there's been a changearound in the session code in express (which makes sense as I suggested we should regress my change and have the sesion id generation be separate from the stores) ... I'm not going to get a chance to look at this for a few hours though :( sorry.

weepy commented 14 years ago

cools :-) I'm just giving the cookie one a whirl instead :D. I'm adding in an option like "only" - as I use the Session to store a few bits and pieces that aren't serializable or relevant.

ciaranj commented 14 years ago

:( The risk is I've tested that to the same version.. I'll fix em both asap :)

weepy commented 14 years ago

cookie one seems ok so far -- im having to change stuff around quite a bit but that's fine really.