2017-01-19 55 views

回答

0

簡答所有商店的方法都可以在這裏得到: https://github.com/expressjs/session#session-store-implementation

長的答案 花了3個步驟來調試此

首先哪裏是req.sessionstore來自哪裏?

https://github.com/btd/connect-session/blob/master/lib/session.js#L78

// expose store 
req.sessionStore = store; 

二,什麼是商店,可以通過選擇在創建會議通過,否則會從MemoryStore的

https://github.com/btd/connect-session/blob/master/lib/session.js#L46

store = options.store || new MemoryStore 

三,MemoryStore的是我們擁有所有二傳手方法的地方

https://github.com/btd/connect-session/blob/master/lib/session/memory.js#L67

MemoryStore.prototype.set 

由於連接和快速有着相似的中間件,用於其他兼容sessionstores而不是默認MemoryStore的,你可以參考

https://github.com/expressjs/session#compatible-session-stores