当前位置:网站首页>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 )
边栏推荐
- 最大连续子段和(动态规划,递归,递推)
- [develop wechat applet local storage with uni app]
- Market status and development prospect prediction of the global autonomous hybrid underwater glider industry in 2022
- Leetcode simple question: the key with the longest key duration
- Compile and decompile GCC common instructions
- 并发操作-内存交互操作
- The usage of micro service project swagger aggregation document shows all micro service addresses in the form of swagger grouping
- [set theory] relationship properties (symmetry | symmetry examples | symmetry related theorems | antisymmetry | antisymmetry examples | antisymmetry theorems)
- Thesis reading_ Chinese medical model_ eHealth
- Career planning of counter attacking College Students
猜你喜欢

论文阅读_ICD编码_MSMN

Review the configuration of vscode to develop golang

The reason why the entity class in the database is changed into hump naming
![[Yu Yue education] basic reference materials of interchangeability and measurement technology of Zhongyuan Institute of Technology](/img/f1/d0dc4dc3fe49a2d2cd9e452a0ce31e.jpg)
[Yu Yue education] basic reference materials of interchangeability and measurement technology of Zhongyuan Institute of Technology

Online VR model display - 3D visual display solution

MediaTek 2023 IC written examination approved in advance (topic)
![[research materials] 2022q1 game preferred casual game distribution circular - Download attached](/img/13/5a67c5d08131745759fdc70a71cf0f.jpg)
[research materials] 2022q1 game preferred casual game distribution circular - Download attached

Actual combat 8051 drives 8-bit nixie tube
![[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached](/img/95/833f5ec20207ee5d7e6cdfa7208c5e.jpg)
[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached

Thesis reading_ Tsinghua Ernie
随机推荐
"Niuke brush Verilog" part II Verilog advanced challenge
2022-02-12 daily clock in: problem fine brush
Literature reading_ Research on the usefulness identification of tourism online comments based on semantic fusion of multimodal data (Chinese Literature)
Market status and development prospect forecast of global heat curing adhesive industry in 2022
Symbol of array element product of leetcode simple problem
[luatos sensor] 1 light sensing bh1750
The simple problem of leetcode: dismantling bombs
1114 family property (25 points)
String matching: find a substring in a string
Shuttle + Alluxio 加速内存Shuffle起飞
Concurrent operation memory interaction
Leetcode simple question: check whether two string arrays are equal
Network security textual research recommendation
Preparation for school and professional cognition
5-36v input automatic voltage rise and fall PD fast charging scheme drawing 30W low-cost chip
Interface frequency limit access
[research materials] the fourth quarter report of the survey of Chinese small and micro entrepreneurs in 2021 - Download attached
C language self-made Games: Sanzi (tic tac toe chess) intelligent chess supplement
联发科技2023届提前批IC笔试(题目)
[luatos sensor] 2 air pressure bmp180