Cookie 显示在回调 url 中,但不显示在浏览器 cookie 存储中
Cookie shows in callback url, but not in browser cookie storage
我正在尝试将 facebookPicUrl
图片保存在 cookie 中。我在回调请求中看到了,但是在浏览器的cookie存储中没有看到。需要说明的是,会话 cookie 没有问题。
auth.route('/auth/facebook/callback')
.get(function(req, res, next) {
passport.authenticate('facebook', function(err, userDoc, info) {
if (err) { return next(err); }
// I don't think !userDoc will ever happen because of mongo upsert
if (!userDoc) { return res.redirect('/login'); }
res.cookie('facebookPicUrl', userDoc.value.facebook.picture, {maxAge : 99999,
httpOnly: false,
secure: false,
signed: false
});
res.redirect('http://127.0.0.1:9000/users')
})(req, res, next);
});
在回调中url:
但不在 cookie 存储中:
res.redirect('http://127.0.0.1:9000/users')
是硬编码值,猜测是req.headers.host
不匹配'127.0.0.1'
我正在尝试将 facebookPicUrl
图片保存在 cookie 中。我在回调请求中看到了,但是在浏览器的cookie存储中没有看到。需要说明的是,会话 cookie 没有问题。
auth.route('/auth/facebook/callback')
.get(function(req, res, next) {
passport.authenticate('facebook', function(err, userDoc, info) {
if (err) { return next(err); }
// I don't think !userDoc will ever happen because of mongo upsert
if (!userDoc) { return res.redirect('/login'); }
res.cookie('facebookPicUrl', userDoc.value.facebook.picture, {maxAge : 99999,
httpOnly: false,
secure: false,
signed: false
});
res.redirect('http://127.0.0.1:9000/users')
})(req, res, next);
});
在回调中url:
但不在 cookie 存储中:
res.redirect('http://127.0.0.1:9000/users')
是硬编码值,猜测是req.headers.host
不匹配'127.0.0.1'