当前位置:网站首页>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 )
边栏推荐
- Caijing 365 stock internal reference: what's the mystery behind the good father-in-law paying back 50 million?
- [luatos sensor] 1 light sensing bh1750
- Network security textual research recommendation
- 联发科技2023届提前批IC笔试(题目)
- Messy change of mouse style in win system
- MPM model and ab pressure test
- Keepalived热备与HAProxy
- Market status and development prospect prediction of the global fire alarm sensor industry in 2022
- Uipath practice (08) - selector
- Notes | numpy-07 Slice and index
猜你喜欢

The reason why the entity class in the database is changed into hump naming
![[luatos sensor] 2 air pressure bmp180](/img/88/2a6caa5fec95e54e3fb09c74ba8ae6.jpg)
[luatos sensor] 2 air pressure bmp180
![[research materials] 2021 China's game industry brand report - Download attached](/img/b7/a377b0b7c742078e2feb28ebfbca62.jpg)
[research materials] 2021 China's game industry brand report - Download attached

Source insight garbled code solution

JDBC database operation

String matching: find a substring in a string

Keepalived热备与HAProxy

First + only! Alibaba cloud's real-time computing version of Flink passed the stability test of big data products of the Institute of ICT
![[luatos sensor] 1 light sensing bh1750](/img/70/07f29e072c0b8630f92ec837fc12d5.jpg)
[luatos sensor] 1 light sensing bh1750
![[tools run SQL blind note]](/img/c3/86db4568b221d2423914990a88eec2.png)
[tools run SQL blind note]
随机推荐
【工具跑SQL盲注】
Handling record of electric skateboard detained by traffic police
Thesis reading_ Chinese NLP_ ELECTRA
Symbol of array element product of leetcode simple problem
Network security textual research recommendation
Coordinatorlayout appbarrayout recyclerview item exposure buried point misalignment analysis
Market status and development prospect prediction of global fermentation acid industry in 2022
第十九届浙江省 I. Barbecue
1115 counting nodes in a BST (30 points)
1119 pre- and post order traversals (30 points)
Oracle SQL table data loss
Keepalived热备与HAProxy
The programmer resigned and was sentenced to 10 months for deleting the code. JD came home and said that it took 30000 to restore the database. Netizen: This is really a revenge
Games101 Lesson 9 shading 3 Notes
Market status and development prospect prediction of global neutral silicone sealant industry in 2022
[luatos sensor] 1 light sensing bh1750
Truncated sentences of leetcode simple questions
论文阅读_中文医疗模型_ eHealth
Market status and development prospect prediction of the global fire hose industry in 2022
论文阅读_ICD编码_MSMN