用的express框架做了个网站, session用的connect-mongodb中间件,才四天表就有29220条数据。并且还在迅猛增加,感觉要爆表的节奏。
5 回复
Note: By connect/express's default, session cookies are set to expire when the user closes their browser (maxAge: null). In accordance with standard industry practices, connect-mongo will set these sessions to expire two weeks from their last 'set'. You can override this behavior by manually setting the maxAge for your cookies -- just keep in mind that any value less than 60 seconds is pointless, as mongod will only delete expired documents in a TTL collection every minute.