Cookie总是保存在客户端中,按在客户端中的存储位置,可分为内存Cookie和硬盘Cookie。

内存Cookie由浏览器维护,保存在内存中,浏览器关闭后就消失了,其存在时间是短暂的。硬盘Cookie保存在硬盘里,有一个过期时间,除非用户手工清理或到了过期时间,硬盘Cookie不会被删除,其存在时间是长期的。所以,按存在时间,可分为非持久Cookie和持久Cookie。

Session cookie

session cookie, also known as an in-memory cookie or transient cookie, exists only in temporary memory while the user navigates the website.[16] Web browsers normally delete session cookies when the user closes the browser.[17] Unlike other cookies, session cookies do not have an expiration date assigned to them, which is how the browser knows to treat them as session cookies.

Persistent cookie

Instead of expiring when the web browser is closed as session cookies do, a persistent cookie expires at a specific date or after a specific length of time. This means that, for the cookie's entire lifespan (which can be as long or as short as its creators want), its information will be transmitted to the server every time the user visits the website that it belongs to, or every time the user views a resource belonging to that website from another website (such as an advertisement).

For this reason, persistent cookies are sometimes referred to as tracking cookies because they can be used by advertisers to record information about a user's web browsing habits over an extended period of time. However, they are also used for "legitimate" reasons (such as keeping users logged into their accounts on websites, to avoid re-entering login credentials at every visit).

These cookies are however reset if the expiration time is reached or the user manually deletes the cookie.

最新文章

  1. C#制作、打包、签名、发布Activex全过程
  2. 如何用python搞定验证码中的噪点
  3. ShineTime - 带有 CSS3 闪亮特效的缩略图相册
  4. HDU 3442 Three Kingdoms(状态压缩 + BFS )
  5. Javascript的事件委托
  6. javascript 判断系统设备
  7. Visual Studio 单元测试之四---Generic测试
  8. 【struts2】ActionContext与ServletActionContext
  9. Tp框架 之对控制器的一些操作等
  10. 201521123074 《Java程序设计》第12周学习总结
  11. Redis总结(六)Redis配置文件全解
  12. 使用jitpack来获取github上的开源项目
  13. phantomjs 开发爬虫框架
  14. chrome强制刷新,非ctrl+f5
  15. vue router 根据不同的id切换链接界面不刷新
  16. js原生实现div渐入渐出
  17. java.lang.NoClassDefFoundError: org/apache/log4j/Priority的问题解决
  18. linux之用户密码破解的操作
  19. python矩阵水平镜像
  20. rand()产生随机数 及其和clock()的不同

热门文章

  1. 从toString()方法到Object.prototype.toString.call()方法
  2. vue2.0中配置文件路径
  3. 20145324 《Java程序设计》第1周学习总结
  4. MysQL使用一查询
  5. 在Jupyter notebook中使用特定虚拟环境中的python的kernel
  6. winform如何让窗体不显示Icon但在任务栏中显示Icon
  7. [spring]Bean注入——在XML中配置
  8. form组件的验证
  9. Apache 配置SSL网站
  10. ls/vi等 command not found