Home > Backend Development > PHP Tutorial > linux下setcookie发生问题

linux下setcookie发生问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 13:21:23
Original
904 people have browsed it

<?php$value = "value";// 发送一个简单的 cookiesetcookie("TestCookie",$value);print_r($_COOKIE);?>
Copy after login

一段简单的存储读取cookie的代码,
放到window下没有问题

放到了linux下出现了问题

就是在读取时候linux下自己添加了一个 ,_ 的标志,试了好几次发现在存入第二个cookie的时候没有问题,第一个会这样。

是什么原因啊?


回复讨论(解决方案)

  没接触过linux@伪砖家 

@以专业开发人员为伍 

cookie 要第二次加载时才能访问,你两种系统下的测试方式肯定不一样。windows下第一次也是空的。

cookie 要第二次加载时才能访问,你两种系统下的测试方式肯定不一样。windows下第一次也是空的。


那为什么非要第二次加载时才能访问呢?这样做是出于安全考虑还是别的什么原因?

测试发现是网络的问题

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