首先安装cookie
npm install cookie-parser
var cookieParser
= require('cookie-parser')
app
.use(cookieParser())
res
.cookie('name', '111', { maxAge
: 1000, httpOnly
: true })
req
.cookies
.xxx
删除cookie
res
.clearCookie('name',{path
:'/'})
转载请注明原文地址: https://mac.8miu.com/read-497058.html