0

如何计算用户电子邮件的登录尝试。我想将它们存储在会话中。我尝试:

req.session[req.body.email] = req.session[req.body.email] + 1;

undefined + 1 = NaN

我该怎么做?

4

1 回答 1

3

为什么不只是?:)

req.session['mailAttempts'] = req.session['mailAttempts'] + 1;

并且不要忘记启用会话

app.use(express.session({secret: '1234567890QWERTY'}));
于 2013-11-11T10:57:29.200 回答