How to share sessions in mounted express apps

后端 未结 1 1630
有刺的猬
有刺的猬 2020-12-30 11:04

I have a fairly complex express based web application that is split up into a few sub apps which are also express apps (using app.use()). How can I seamlessly u

1条回答
  •  失恋的感觉
    2020-12-30 11:39

    the middleware bundled with Connect are "self aware" in that they will not duplicate work they've already done. So for example if you have req.session already, and both the "root" app, and a mounted app utilize the session() middleware, the root app's session will work, and the other will be ignored. So it should work as-is.

    0 讨论(0)
提交回复
热议问题