From 44e05e6220570f2ba2f4b045d533e0aab99bd9de Mon Sep 17 00:00:00 2001 From: fatchan Date: Fri, 26 Apr 2019 11:12:10 +0000 Subject: [PATCH] captcha string instead of mongoid class fixes json cookie issue for nginx --- models/pages/captcha.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/models/pages/captcha.js b/models/pages/captcha.js index 32aaee14..9acf9c94 100644 --- a/models/pages/captcha.js +++ b/models/pages/captcha.js @@ -23,9 +23,10 @@ module.exports = async (req, res, next) => { } return res - .cookie('captchaid', captchaId, { + .cookie('captchaid', captchaId.toString(), { 'maxAge': 5*60*1000, //5 minute cookie - 'httpOnly': true + 'httpOnly': true, + 'secure': true }) .redirect(`/captcha/${captchaId}.png`);