📜  如何使用 express 框架在节点 js 中设置 cookie? - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:21.438000             🧑  作者: Mango

代码示例1
res.cookie('cookie', 'monster');

// Full controller code:
app.get("/", (req,res)=>{
  res.cookie("key","value");
  res.send("Check your cookies mate!");
});

// Reference: https://expressjs.com/en/4x/api.html#res.cookie