当前位置:网站首页>带你深入了解Cookie
带你深入了解Cookie
2022-08-05 05:21:00 【lsely】
带你深入了解Cookie
此文只是介绍Cookie一些基础知识和构成Cookie的组成部件,并不介绍用法。
Cookie是什么鬼?
Cookie , 在百度百科中的介绍是指"储存在用户本地终端上的数据",用人话来说就类似于浏览器在本地的缓存,它是网站用来识别用户的一个文本。一般来说,在我们打开网站时,网站的Web服务器会为用户生成一个ID信息,可以说这就是用户的网络”身份证“,然后这个”身份证“就会保存到用户的电脑本地,以后如果用户再次登入这个网站,Web服务器就可以读取这个文本,就可以获取用户的各个信息了,这个过程也就是登录。

Cookie的发送机制
总体来说,每当我们第一次登录一个网站时,Web服务器就会发送一个Cookie到用户本地,在以后的登录中,用户本地的Cookie就会发送到Web服务器,从而验证自己的账户,用一张图来表示:
Cookie的组成
Cookie本质上还是一个文本数据,一般这个数据是经过加密的,由名称,值,还有几个用于控制Cookie使用范围或有效时间等量组成。
- 名称和值 Name/Value:Cookie的名称以及值。
- 有效期 Expires:Cookie的有效期。Expriers分为两种存储方式:会话性与持久性。会话性Cookie,保存在用户的内存中,会在推出浏览器时清空;而持久性Cookie会保存在用户的本地硬盘中,直至用户退出登录时才会失效 。说人话就是一个临时存储,一个长久存储。
- 使用范围 Domain:Cookie的使用于访问范围。
- 安全性 Secure:Cookie是否使用Https协议。
总结
Cookie是网站用于识别用户身份,保存在用户本地上的数据(经过加密),由用户本地暂时或长久保存的文本数据,一般由名称,值,有效期,使用范围等组成。
边栏推荐
- spark source code-RPC communication mechanism
- lvm逻辑卷及磁盘配额
- What are some things that you only know when you do operation and maintenance?
- Transport layer protocol (TCP 3-way handshake)
- 【Day8】RAID Disk Array
- Dsf5.0 bounced points determine not return a value
- [Day5] Soft and hard links File storage, deletion, directory management commands
- IP数据包格式(ICMP协议与ARP协议)
- This is indeed the best article on microservice architecture I have read!
- Getting Started Doc 08 Conditional Plugins
猜你喜欢

VRRP principle and command
![[Day8] Commands involved in using LVM to expand](/img/ba/39b81cbcecec9bc54a710ff9dba81a.png)
[Day8] Commands involved in using LVM to expand

Remembering my first CCF-A conference paper | After six rejections, my paper is finally accepted, yay!

单臂路由实验和三层交换机实验

The problem come from line screening process

从“双卡双待“到”双通“,vivo率先推动DSDA架构落地

VLAN details and experiments

ALC实验

The highlight moment of operation and maintenance starts with intelligence

RAID磁盘阵列
随机推荐
Account and Permission Management
spark source code - task submission process - 3-ApplicationMaster
传输层协议(TCP3次握手)
时间复杂度和空间复杂度
spark operator-wholeTextFiles operator
The spark operator - repartition operator
Remembering my first CCF-A conference paper | After six rejections, my paper is finally accepted, yay!
vim教程:vimtutor
路由器和静态路由的配置
To TrueNAS PVE through hard disk
深度 Zabbix 使用指南——来自惨绿少年
time complexity and space complexity
Mongodb query analyzer parsing
RAID disk array
图片压缩失效问题
Disk management and file systems
Spark source code - task submission process - 6-sparkContext initialization
Quick question and quick answer - FAQ of Tencent Cloud Server
Getting Started Doc 08 Conditional Plugins
运维工程师,快来薅羊毛