Home > Backend Development > PHP Tutorial > 为什么同一站点,不同目录上,同一浏览器的COOKIE不一样

为什么同一站点,不同目录上,同一浏览器的COOKIE不一样

WBOY
Release: 2016-06-13 12:56:12
Original
1021 people have browsed it

为什么同一站点,不同目录下,同一浏览器的COOKIE不一样?
我在 /order/

a.php  设置 cookie;

setcookie("buydd",$buyid,time()+3600,"/","127.0.0.1");

print_r($_COOKIE);


/order/pay/ 

b.php 里

print_r($_COOKIE);

却发现 b.php 里死活都没有 buydd 这个 cookie ,无论怎么刷新也没,

其他cookie项目也很不一样,很奇怪啊!


------解决方案--------------------
抓个包看看header里cookie的有效期吧?
Related labels:
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