I am currently following this guide to allow socket.io to read express session storage: http://www.danielbaulig.de/socket-ioexpress/
Basically, I am using express.session.MemoryStore for session memory, and exposing that in a global variable that i can refer to in other places such as socket.io (for authentication)
However, the problem arise when i try to run the app in NODE_ENV=production, the app gives me the following warning:
Warning: connection.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and obviously only work within a single process.
Anyone have any idea of how to properly resolve this?
Thanks a lot :)
yeah that's because MemoryStore is just a default, you never really want to use it in production (unless it's a blog or something then maybe I guess)
Thanks a lot for your prompt answer!
So do you have a recommended alternative to the default session storage? Perhaps one that has similar api to memorystore?
Thanks again :)
they all have the same api :) I use connect-redis personally
I will look into it, thanks a lot :)