cookie 原理
- Header Set-Cookie负责设置cookie
- 请求传递Cookie
const express = require('express')
const app = express()
app.get('/', function(req, res) {
const cookie = req.headers.cookie
console.log(cookie)
res.setHeader('Set-Cookie', 'cookie1=abcde')
res.json({
message: '登录成功'
})
})
app.listen(3000)