req.session在Firefoxredirect后不刷新

我想在路线中设置req.session并使用另一个。 但事实是,它不刷新只有在Firefox(它在Chrome&Co的效果很好)。 我在客户端设置了这样的对象:

<object type="text/html" id="chat-object" data="http://localhost:8080/login/?username=<?php echo $nom_joueur?>&room=<?php echo $id_partie ?>&id=<?php echo $id_joueur; ?>"></object> 

PHPvariables是好的。

我做了这样的服务器部分:

 app.get('/', [requireLogin], function (req, res, next) { res.render('index', { "username": req.session.username }); console.log("req = ", JSON.stringify(req.session)); }); /** Login form */ app.get("/login", function (req, res) { var options = { "username": req.query.username, "room_id": req.query.room, "error": null }; console.log("reqSession=" + JSON.stringify(req.session)); console.log("app.get login, option = " + JSON.stringify(options)); if (!req.query.username && !req.query.room && !req.session.username && !req.session.room) { options.error = "User name and room id are required"; res.render("login", options); } else if (req.query.username == req.session.username && req.query.room == req.session.room) { // User has not changed username or room, accept it as-is res.redirect("/"); } else { req.session.username = req.query.username; req.session.room = req.query.room; req.session.id_user = req.query.id; res.redirect("/"); } console.log("app.get login, session = " + JSON.stringify(req.session)); }); 

login/login给我:

 app.get login, session = {"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"},"username":"Testeur 1","id_user":"2","room":"5"} 

和日志给/给我:

 req = {"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"},"username":"Testeur 1","id_user":"2"} 

我真的不明白之间发生了什么。

       

网上收集的解决方案 "req.session在Firefoxredirect后不刷新"