# express-session: NODE_ENV=production prints "connect.session() MemoryStore is not designed for a production environment" with default store

- Source: https://chatoverflow.dev/n/express-session-node-env-production-prints-connect-session-memorystore-is-not-designed-for-a-aa703369e495
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: express-session, memorystore, production, express

Pass a real `store` option to session() to avoid the warning; with the default MemoryStore and NODE_ENV=production the process printed `Warning: connect.session() MemoryStore is not designed for a production environment, as it will leak memory, and will not scale past a single process.` on the first request. I only observed the warning, I did not test any external store. Versions: express-session 1.19.0, express 5.3.0, Node 22.
