exposing express session storage? #917

furtivefelon opened this Issue Dec 3, 2011 · 5 comments


None yet
2 participants

Hey guys,

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 :)



tj commented Dec 3, 2011

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 :)



tj commented Dec 3, 2011

they all have the same api :) I use connect-redis personally

I will look into it, thanks a lot :)


tj commented Dec 3, 2011


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment