当前位置:网站首页>Cookies and sessions
Cookies and sessions
2022-06-12 21:24:00 【Comma 8080】
Cookie
Why does it show up Cookie
as everyone knows ,http Protocol is stateless , Without services, users cannot be identified only from the network connection , There will be a problem , When we log in to a website, we have to log in again every time we refresh the page , Such an experience is undoubtedly very bad , Just imagine : We were robbing goods on the double 11 , Each time you refresh one, you will log in again , It may be that the page is refreshed and then the goods are sold out
To make up for it http Request stateless deficiency , There is cookie, You can put cookie Understood as a pass , After the user's browser accesses the server, the server issues a pass to the browser , Then the browser carries the pass to the server , The server can identify the user .
Session
if Cookie It is the pass used to confirm the user's identity , that Session It's equivalent to a “ User details ”,Session Save on the server , Set up Cookie And put SessionID Save to Cookie Send to browser , When the browser accesses again, it only needs to start from the Session To find the status of the customer , and SessionID Is a string of irregular strings , There is no great risk of being captured by hackers , At the same time, the server is sending Cookie Previously, the SessionID Of Cookie To sign , If the hacker modifies SessionID Then the server will not recognize SessionID
Token
When we send out a HTTP Request to server A Get one Cookie + SessionID, When requesting again , This is load balancing that forwards requests to the server B On , The server B There is no corresponding Session At this point, the user status cannot be verified , To solve this situation, we can use Token
The server signs the data , Make the data and signature into one token Send to send to client , The server does not save token take token Send it to the client for saving , Client with token For the request , The server only needs to get the corresponding token And then decrypt it ,
边栏推荐
- lintcode:127 · 拓扑排序
- Integrated monitoring solution for power environment of small and medium-sized computer rooms
- 实现从字符串中删除某个字符操作
- Is it safe to open an account in flush? How to open an account online to buy stocks
- To delete a character from a string
- Fill in the checklist & lt; int> Have default values? [repeat] - fill list & lt; int> with default values? [duplicate]
- Module 8: Design message queue MySQL table for storing message data
- C language learning notes (II)
- leetcode:210. 课程表 II
- Mxnet record IO details
猜你喜欢
GNS安装与配置
Lake shore PT-100 platinum resistance temperature sensor
Integrated monitoring solution for power environment of small and medium-sized computer rooms
Structure knowledge points all in
测试基础之:单元测试
Composer version degradation
Solution of multi machine room dynamic loop status network touch screen monitoring
The salted fish has been transmitted for 5W times, and the latest spring recruit face-to-face test questions of bytes have been leaked
String Basics
Product Manager: "click here to jump to any page I want to jump" -- decoupling efficiency improving artifact "unified hop routing"
随机推荐
居家办公期间如何提升沟通效率|社区征文
zgc的垃圾收集的主要阶段
A blog written clearly by vit
Solve one-dimensional array prefix sum
Composer version degradation
What's a good gift for the goddess Festival? Gift recommendation for the goddess Festival on March 8
初步了解認識正則錶達式(Regex)
Access control system based on RFID
Preliminary understanding of regular expressions (regex)
Data visualization - biaxial comparison effect
Simplest ALV template
My way of programming
#141 Linked List Cycle
Leetcode: 210. Programme II
Do we media video, and share the necessary app for friendly new media operation
Integrated monitoring solution for power environment of small and medium-sized computer rooms
leetcode:207. Class Schedule Card
String Basics
Can flush open an account? Can you directly open the security of securities companies on the app
Design and practice of Hudi bucket index in byte skipping