我想为同一个帐户创建多个登录的会话现在我正在为任何特定用户存储唯一的会话字符串现在我的问题是,当我使用快速会话时,然后在其文档页面上enter link description here它提到了
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
现在我的问题是,因为我正在创建一个商业应用程序,我应该使用它,如果我不使用那么什么是最好的存储会话我听说过redis但我也听说它消耗了很多内存,这就是为什么可以请大家放一些我真的很有意思 .
1 回答
常见的三个更有用的选项而不是
MemoryStore
:CookieSession
connect-redis
connect-mongo
来自here
我建议你使用
CookieSession
,因为它更简单快速 . 来自docs的简单示例:到期时间:
您可以在属于当前用户的单个cookie上设置expires或maxAge: