Files
ClassContent/项目合集/最新写真app/fontend/笔记.txt
2025-03-16 23:01:07 +08:00

26 lines
662 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

cookies:
把用户登录成功的状态放在请求头中
每次访问网址的时候后端会从请求头中拿到cookies
然后判断用户是否登录成功
缺点:
cookie可能被禁用
cookie与浏览器相关不能互相访问
cookie可能被用户删除
cookie安全性不够高
cookie存储空间很小(只有410KB左右)
session:
生命周期是仅在当前浏览器窗口关闭前有效,不能持久保持。
在整个浏览器未关闭前其数据一直都是存在的。存储大小一般为5M
localStorage:
http 协议 它是无状态
状态(是否登录)
http
http