当前位置:网站首页>The differences and advantages and disadvantages between cookies, seeion and token
The differences and advantages and disadvantages between cookies, seeion and token
2022-07-06 07:07:00 【smarthome_ man】
1、cookie( A computer file of information sent by a network or Internet user to a central server )
First of all, what is cookie Well ? seeing the name of a thing one thinks of its function cookie The first is a file , It is mainly a data generated by the browser that can be permanently stored in the browser . For example, our account number and password , Will be stored in cookie in , The next time you ask , Will directly enter the account password , It's more convenient , But the disadvantages also follow ,cookie It's easy to be hijacked by hackers , therefore cookie The security of is lower , So later, the browser added some restrictions to ensure cookie Will not be used maliciously , But the security is not very high .
2、session( In network applications, it is also called session control )
What is? session? Literally session It's conversation , Talk to someone one by one , It's your conversation with him , How do you know that it is Zhang San rather than Li Si who is talking to you , The other party must have some characteristics to show that he is Zhang San , For example, height , Age , Looks, etc .
session It also has similar meaning , The server should know that it is currently talking to itself ( Send a request to yourself ) Who is it . In order to distinguish between , The server will assign different tags to each client , Then when the client sends a request to the server , Will wear this mark to determine the identity of this person , The server will know who it is talking to , So how does the client save this tag , There are many ways , But for browsers , Are all adopted by default cookie Methods .
Server usage session Save the user's information on the server temporarily , But after the user leaves the website session Will destroy , however cookie It won't be destroyed , This storage method is relative to cookie For more security , Each has its own advantages .
3、token( token )
What is? token,Token Is a string generated by the server , As a token for the client to make a request , After the first login , The server generates a Token This is what we call it Token Return to the client , In the future, the client only needs to bring this Token Just come and ask for data , No need to bring user name and password again .
cookie And session The difference between
1、cookie Data is stored on the client ,session Data on the server .
2、cookie Not very safe , Should be used in consideration of safety session.
3、session It will be saved on the server for a certain period of time . When visits increase , We will compare the performance of your server to reduce the performance of your server , Should be used cookie.
边栏推荐
- [advanced software testing step 1] basic knowledge of automated testing
- 【JDBC】快速入门教程
- Simple use of MySQL database: add, delete, modify and query
- The best way to learn SEO: search engine
- A method to measure the similarity of time series: from Euclidean distance to DTW and its variants
- 漏了监控:Zabbix对Eureka instance状态监控
- Depth residual network
- Short video, more and more boring?
- Attributeerror: can 't get attribute' sppf 'on < module' models. Common 'from' / home / yolov5 / Models / comm
- Oracle数据库11gr2使用tde透明数据加密报错ora28353,如果运行关闭wallet会报错ora28365,运行打开wallet就报错ora28353无法打开wallet
猜你喜欢
18. Multi level page table and fast table
配置树莓派接入网络
Huawei equipment configuration ospf-bgp linkage
SEO学习的最好方式:搜索引擎
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Kubernetes cluster builds ZABBIX monitoring platform
After sharing the clone remote project, NPM install reports an error - CB () never called! This is an error with npm itself.
开源的网易云音乐API项目都是怎么实现的?
呆错图床系统源码图片CDN加速与破解防盗链功能
Path analysis model
随机推荐
Upgraded wechat tool applet source code for mobile phone detection - supports a variety of main traffic modes
Practical guidance for interface automation testing (Part I): what preparations should be made for interface automation
At the age of 26, I changed my career from finance to software testing. After four years of precipitation, I have been a 25K Test Development Engineer
The best way to learn SEO: search engine
因高额网络费用,Arbitrum 奥德赛活动暂停,Nitro 发行迫在眉睫
Cif10 actual combat (resnet18)
Cookie Technology & session Technology & ServletContext object
接口自动化测试框架:Pytest+Allure+Excel
Visitor tweets about how you can layout the metauniverse
Briefly describe the differences between indexes, primary keys, unique indexes, and joint indexes in mysql, and how they affect the performance of the database (in terms of reading and writing)
【每日一题】729. 我的日程安排表 I
树莓派3B更新vim
这个高颜值的开源第三方网易云音乐播放器你值得拥有
Bio model realizes multi person chat
A method to measure the similarity of time series: from Euclidean distance to DTW and its variants
Simple use of JWT
LeetCode 78:子集
UWA pipeline version 2.2.1 update instructions
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models. common‘ from ‘/home/yolov5/models/comm
从autojs到冰狐智能辅助的心里历程