按名称req.cookies的一部分获取cookie

时间:2019-05-20 01:17:06

标签: javascript node.js cookies

我需要获取Cookie,其名称仅以“ CartItem ....”开头。但是idk该怎么做

我尝试了req.cookies []

Cart: (req, res) => {
    let items_id = req.cookies; //here i need cookies, where names start with "CartItem..."
    res.render('routes/views/cart', {
      items_id
    });
  }

0 个答案:

没有答案