Home > Backend Development > PHP Tutorial > COOKIE 保存域问题

COOKIE 保存域问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 14:27:27
Original
963 people have browsed it

COOKIE

setcookie("web","string",time()+3600,"/","127.0.0.1");

为什么不能实现全站域保存呢?那位知道这是为什么?

回复讨论(解决方案)

setcookie("web","string",time()+3600,"/");

两个站点都加上
ini_set('session.cookie_path', '/');
ini_set('session.cookie_domain', '.域名.com');
ini_set('session.cookie_lifetime', '1800');

Related labels:
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