Nodejs Connect/Express how session manage memory

半腔热情 提交于 2019-12-04 12:45:14

The Connect MemoryStore (the default session storage module for the Session middleware) will not garbage-collect expired sessions. It only checks their expiration when they are accessed (at which point it will delete the storage if the session is expired), so if the user clears their cookies, the session will never be accessed again, and will never expire from the MemoryStore. Hence the warning at the Session middleware docs that MemoryStore shouldn't be used in production.

Connect does not provide other session storage modules and expects you to supply your own, building on the abstract Store module included with the Session middleware.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!