Home >Backend Development >PHP Tutorial >cookie过期应该怎么设置

cookie过期应该怎么设置

WBOY
WBOYOriginal
2016-06-13 11:44:461576browse

cookie过期应该如何设置
假设 我登陆网站后
setcookie(abc["admin"], "zhang", time() + 3600);
setcookie(abc["name"], "张三", time() + 3600);

当我刷新页面后,过期时间应该是从当前再加上3600秒

如果是ASP,可以直接在conn.asp里设置
Response.Cookies("abc").expires=DateAdd("n", 60, Now())
当刷新页面后abc下的所有cookie都会把过期时间变成当前时间加上60分钟

PHP的话 要如何批量延长过期时间?

Statement:
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