when should I use cookie-parser with express-session?

后端 未结 2 1030
再見小時候
再見小時候 2021-02-02 06:54

In most ExpressJs example, I found using cookie-parser with express-session.

If I could access session data with req.session.name

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-02 07:47

    In addition to providing simple cookie parsing functionality, the cookie-parser middleware enables signed cookies which can be referenced by other middleware components, using an optional secret attribute.

    Why would you want signed cookies? This question addresses that well

提交回复
热议问题