Node.js use Redis as Session storage
In previous post, we use default Session storage to test. However, it is not suitable in production stated by the developer. "Warning The default server-side session storage, MemoryStore , is purposely not designed for a production environment. It will leak memory under most conditions, does not scale past a single process, and is meant for debugging and developing. " In this post, I will use Redis (famous and widely-used in-memory store) as the storage of Session. We can also the module connect-redis in express-session npm package webpage . We modify the code(v2.3) in post Node.js use passport with LocalStrategy in Authentication Part 4 . It use session to use login user information and failure messages. If you just follow the steps in connect-redis webpage and run, you will find connect error message in terminal. import { RedisStore } from "connec...