cookie在安全方面,有2个重要属性,一个是httpOnly,一个是secure.
如果给cookie设置了httpOnly属性,那么浏览器的js脚本将不能够读取cookie。
如果给cookie设置了secure属性,那么此cookie只能通过https传递,而不能通过http传递。
ASP.NET Core 3.0 httponly of cookie
https://www.cnblogs.com/OpenCoder/p/8341843.html
https://www.cnblogs.com/shangstacey/p/12717981.html
JWT:json,web token
string:A.B.C
hs256 对称加密
结构:
header:
payload:
hs256:
JWT使用方式:
1.客服端到服务器端认证;
2.认证成功返回token;
3.客服端在请求头Head中加入authorization:Bearer{token}访问API资源
https://www.cnblogs.com/51net/p/12793723.html