Home  >  Article  >  Backend Development  >  php cookie奇咄咄怪事,显示不一致

php cookie奇咄咄怪事,显示不一致

WBOY
WBOYOriginal
2016-06-13 12:43:40733browse

php cookie奇怪事,显示不一致
localhost/test.php
localhost/test/test.php

这两个文件是同一个文件考过去的
内容就是一句话  print_r($_COOKIE);
但是两个url显示的确是不一样的数据啊
//Array ( [TEST] => TEST index ) 
//Array ( [TEST] => TEST test ) 
本能认为肯定是我重set了,
但我仔细检查N遍了,现在就是一句话,print_r($_COOKIE);
怎么cookie和路径有关系了呢?????

设置一次我就把下句删掉了,我是这样设的,不应该与路径有关啊
//setcookie("TEST","TEST index", time()+3600*24*1);


另外说明一点,同级目录得到数据是相同的,求解~~~~~~~~~~~~~~~~

Cookie 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