You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use it in conjunction with a MongoStore, which also powers my Express HTTP sessions. Only thing is, when I (from inside a socket.io callback) modify the session exposed by this library, it only seems to persist in memory; when I restart the server, the changes are not reflected (and thus weren't saved in MongoDB).
Am I wrong in expecting the changes to be perserved in MongoDB? Or is the session only exposed as read-only through socket.io.
The text was updated successfully, but these errors were encountered:
I'm not sure how to answer this directly but I will give you some information to go through and find the answer. When you do session.someValue = 1, it may look like it's not persisting anything as it's just changing an attribute in memory.
However someValue could be a setter (see links below) that also trigger a callback that persist into MongoDB. If not implemented yet, you could use this or a similar approach to keep your db synced.
Before implementing I'd also suggest asking this on MongoStore repo as they might have a configuration that do this job already.
Hey,
Great little library you've got here.
I use it in conjunction with a MongoStore, which also powers my Express HTTP sessions. Only thing is, when I (from inside a socket.io callback) modify the session exposed by this library, it only seems to persist in memory; when I restart the server, the changes are not reflected (and thus weren't saved in MongoDB).
Am I wrong in expecting the changes to be perserved in MongoDB? Or is the session only exposed as read-only through socket.io.
The text was updated successfully, but these errors were encountered: