码迷,mamicode.com
首页 > 其他好文 > 详细

临时cookie和永久cookie对比

时间:2014-10-10 17:13:34      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:cookie   lamp   

Session cookies - these are temporary and are erased when you close your browser at the end of your surfing session. The next time you visit that particular site it will not recognise you and will treat you as a completely new visitor as there is nothing in your browser to let the site know that you have visited before

不设置过期时间,则表示这个cookie生命周期为浏览器会话期间,只要关闭浏览器窗口,cookie就消失了。这种生命期为浏览会话期的cookie被称为会话cookie。会话cookie一般不保存在硬盘上而是保存在内存里。

 

Persistent cookies - these remain on your hard drive until you erase them or they expire. How long a cookie remains on your browser depends on how long the visited website has programmed the cookie to last

设置了过期时间,浏览器就会把cookie保存到硬盘上,关闭后再次打开浏览器,这些cookie依然有效直到超过设定的过期时间。

存储在硬盘上的cookie可以在不同的浏览器进程间共享,比如两个IE窗口。而对于保存在内存的cookie,不同的浏览器有不同的处理方式。


本文出自 “运维之家(Q群:1991706)” 博客,请务必保留此出处http://304076020.blog.51cto.com/7503470/1561992

临时cookie和永久cookie对比

标签:cookie   lamp   

原文地址:http://304076020.blog.51cto.com/7503470/1561992

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!