当前位置:网站首页>带你深入了解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是网站用于识别用户身份,保存在用户本地上的数据(经过加密),由用户本地暂时或长久保存的文本数据,一般由名称,值,有效期,使用范围等组成。
边栏推荐
- VLAN详解及实验
- 入门文档05 使用cb()指示当前任务已完成
- Servlet跳转到JSP页面,转发和重定向
- 入门文档04 一个任务依赖另外一个任务时,需要按顺序执行
- Spark source code-task submission process-6.1-sparkContext initialization-create spark driver side execution environment SparkEnv
- Switch principle
- Insight into the general trend of the Internet, after reading this article, you will have a thorough understanding of Chinese domain names
- vim的三种模式
- Cloud computing - osi seven layers and TCP\IP protocol
- ACL 和NAT
猜你喜欢

实力卷王LinkSLA,实现运维工程师快乐摸鱼

监控系统的内卷,有什么讲究?

LinkSLA insists that users come first and creates a sustainable operation and maintenance service plan

Dsf5.0 bounced points determine not return a value

Account and Permission Management

入门文档01 series按顺序执行

错误类型:反射。ReflectionException:无法设置属性“xxx”的“类”xxx”与价值“xxx”

What are some things that you only know when you do operation and maintenance?

RAID磁盘阵列

Getting Started Documentation 12 webserve + Hot Updates
随机推荐
Getting Started 03 Distinguish between development and production environments ("hot update" is performed only in the production environment)
Image compression failure problem
Disk management and file systems
IP地址及子网的划分
Hugo搭建个人博客
入门文档11 自动添加版本号
智能运维会取代人工运维吗?
入门文档07 分阶段输出
ALC实验
IP packet format (ICMP protocol and ARP protocol)
实力卷王LinkSLA,实现运维工程师快乐摸鱼
Servlet跳转到JSP页面,转发和重定向
markdown editor template
入门文档03 区分开发与生产环境(生产环境才执行‘热更新’)
Spark source code-task submission process-6.2-sparkContext initialization-TaskScheduler task scheduler
入门文档06 向流(stream)中添加文件
What?CDN cache acceleration only works for accelerating static content?
What impact does CIPU have on the cloud computing industry?
The problem of redirecting to the home page when visiting a new page in dsf5.0
磁盘管理与文件系统