Node.js - Session doesn't persist through res.redirect()

前端 未结 5 1194
甜味超标
甜味超标 2021-02-09 01:37

I\'m (almost) successfully using Node.js with Express and Redis to handle sessions.

The problem I\'m having is that the session is not kept when I use res.redirect

5条回答
  •  一生所求
    2021-02-09 02:04

    Did you try with different browsers ? Are you keeping the same session id between page redirects ?

    You could add req.session.cookie.expires = false; before redirecting...

提交回复
热议问题