当前位置:网站首页>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 )
边栏推荐
- Market status and development prospect prediction of the global autonomous hybrid underwater glider industry in 2022
- Current market situation and development prospect forecast of the global fire boots industry in 2022
- Shell script Basics - basic grammar knowledge
- The simple problem of leetcode: dismantling bombs
- [XSS bypass - protection strategy] understand the protection strategy and better bypass
- 1118 birds in forest (25 points)
- Market status and development prospect prediction of global colorimetric cup cover industry in 2022
- 逆袭大学生的职业规划
- [research materials] annual report of China's pension market in 2021 - Download attached
- Handler understands the record
猜你喜欢
Symbol of array element product of leetcode simple problem
Online VR model display - 3D visual display solution
RT thread flow notes I startup, schedule, thread
[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached
Games101 Lesson 9 shading 3 Notes
Analysis of proxy usage of ES6 new feature
Cross platform plug-in flutter for displaying local notifications_ local_ notifications
Flutter monitors volume to realize waveform visualization of audio
I stepped on a foundation pit today
Valentine's day limited withdrawal guide: for one in 200 million of you
随机推荐
RT thread flow notes I startup, schedule, thread
LVS load balancing cluster of efficient multi-purpose cluster (NAT mode)
【SQL注入点】注入点出现位置、判断
[SQL injection point] location and judgment of the injection point
[luatos sensor] 1 light sensing bh1750
1118 birds in forest (25 points)
Market status and development prospect prediction of the global fire alarm sensor industry in 2022
MediaTek 2023 IC written examination approved in advance (topic)
论文阅读_中文医疗模型_ eHealth
Keepalived热备与HAProxy
1119 pre- and post order traversals (30 points)
[USACO 2009 Dec S]Music Notes
[research materials] 2021 annual report on mergers and acquisitions in the property management industry - Download attached
Objects. Requirenonnull method description
Market status and development prospects of the global IOT active infrared sensor industry in 2022
Thesis reading_ Chinese medical model_ eHealth
Career planning of counter attacking College Students
[research materials] 2021 China's game industry brand report - Download attached
Current market situation and development prospect forecast of global UV sensitive resin 3D printer industry in 2022
Unity tool Luban learning notes 1