当前位置:网站首页>cookie session jwt
cookie session jwt
2022-07-03 04:56:00 【rjlmylove_ zyw】
List of articles
cookie
yes Exist in the browser A voucher for
- When the browser first accesses the server , Will create a cookie
- Back to browser
- cookie It contains all the information of users
- When the user accesses the server again , Carry cookie( A voucher )
- According to the information carried by the server cookie Different users have different information

session
- When the browser accesses the server , The server creates a session , At the same time, a special cookie , (name by JSESSIONID Fixed value of ,value by session Object's ID) Send to browser side
- When the browser accesses the server again , With that fixed name Of cookie
- Server according to name Go to query session Inside id , So as to distinguish different users

cookie and session difference
- cookie Save in browser session Save on the server
- session want More secure If you intercept one cookie And forge a packet again , The server cannot distinguish , cookie There's a security problem
- session It will be saved on the server for a certain period of time . When visits increase , Will compare Occupy the performance of your server , If the main consideration is to reduce server performance , Should be used COOKIE
- Single cookie The limit on the client side is 3K, That is to say, a site is stored in the client COOKIE You can't 3K.
- therefore : Store the login information and other important information as session; Other information if needed to be retained , Can be placed in cookie in
jwt
JSON Web Token(JWT)
- jwt The essence is that the server encrypts the user information and generates a string to return to the browser
- jwt There are clients , Generated by the backend , Pass it on to the front end , Local storage exists
- special JSON
- Every time you visit the server, you will bring
- jwt from jwt head , Payload , Signature composition
- jwt head It's a description JWT Metadata JSON object
- Valid fields It's information that users don't have sensitive words
- Signature It is to sign the contents of the first two parts , Ensure that the information will not be tampered
Reference resources Cookie and Session The difference between ( For the interview )
边栏推荐
- 关于开学的准备与专业认知
- [research materials] 2022q1 game preferred casual game distribution circular - Download attached
- Actual combat 8051 drives 8-bit nixie tube
- The 19th Zhejiang I. barbecue
- 5-36v input automatic voltage rise and fall PD fast charging scheme drawing 30W low-cost chip
- Caijing 365 stock internal reference: what's the mystery behind the good father-in-law paying back 50 million?
- 1107 social clusters (30 points)
- Shuttle + Alluxio 加速内存Shuffle起飞
- [clock 223] [binary tree] [leetcode high frequency]: 102 Sequence traversal of binary tree
- Introduction to JVM principle
猜你喜欢
![[set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa](/img/a9/92059db74ccde03b84c69dfce35b37.jpg)
[set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa

C language self-made Games: Sanzi (tic tac toe chess) intelligent chess supplement

SSM framework integration

带有注意力RPN和多关系检测器的小样本目标检测网络(提供源码和数据及下载)...

"Niuke brush Verilog" part II Verilog advanced challenge

【XSS绕过-防护策略】理解防护策略,更好的绕过

Without 50W bride price, my girlfriend was forcibly dragged away. What should I do

The principle is simple, but I don't know how to use it? Understand "contemporaneous group model" in one article

Compile and decompile GCC common instructions

Flutter monitors volume to realize waveform visualization of audio
随机推荐
50 practical applications of R language (36) - data visualization from basic to advanced
Sprintf formatter abnormal exit problem
Objects. Requirenonnull method description
Source insight garbled code solution
Problems encountered in fuzzy query of SQL statements
Leetcode simple question: check whether the array is sorted and rotated
Actual combat 8051 drives 8-bit nixie tube
Without 50W bride price, my girlfriend was forcibly dragged away. What should I do
Symbol of array element product of leetcode simple problem
Handling record of electric skateboard detained by traffic police
Market status and development prospects of the global autonomous marine glider industry in 2022
RT thread flow notes I startup, schedule, thread
Current market situation and development prospect forecast of the global fire boots industry in 2022
C language self-made Games: Sanzi (tic tac toe chess) intelligent chess supplement
The simple problem of leetcode: dismantling bombs
5-36v input automatic voltage rise and fall PD fast charging scheme drawing 30W low-cost chip
Market status and development prospect prediction of the global forward fluorescent microscope industry in 2022
移动端——uniapp开发记录(公共请求request封装)
1111 online map (30 points)
MPM model and ab pressure test