Home > Backend Development > PHP Tutorial > 怎么获得cookie失效时间?

怎么获得cookie失效时间?

WBOY
Release: 2016-06-23 13:31:43
Original
1902 people have browsed it

客服端某一天读取网页时,用php  的setcookie写入的一个COOKIE,
比如:setcookie(“name","value",time()+864000)
怎么知道这个cookie还有多长时间失效?以便 如果失效时间小于1天快过期,就重新写入。


回复讨论(解决方案)

浏览器决定它的失效时间,这个失效时间其实是无意义的,如果真要知道失效时间,应该同时把这个失效时间存到cookie值里 (做好必要的加密或校验)

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template