Node.js and Express session handling - Back button problem

后端 未结 4 1892
無奈伤痛
無奈伤痛 2020-12-23 19:04

I have a restricted area \'/dashboard\' in my Express application. I use a very small function to limit the access:

app.get(\'/dashboard\', loadUser, functi         


        
4条回答
  •  爱一瞬间的悲伤
    2020-12-23 19:44

    app.get('/dashboard', loadUser, function(req, res){
      res.header('Cache-Control', 'no-cache');
      res.header('Expires', 'Fri, 31 Dec 1998 12:00:00 GMT');
    
      res.render('dashboard', {
        username: req.session.username
      });
    });
    

提交回复
热议问题