Home > Backend Development > PHP Tutorial > php cookie解决方法

php cookie解决方法

WBOY
Release: 2016-06-13 13:09:18
Original
951 people have browsed it

php cookie
为什么我在程序中 setCookie("username","zhangsan",time()+3600*24,"/"); 这样写在新打开的窗口获取不了那个cookie值呢,以前是管用的两天之后又不管用了,还有cookie跨域怎么使用啊, 请高手赐教......


------解决方案--------------------
setCookie("username","zhangsan",time()+3600*24,"/")你这样写是不是有问题的。
------解决方案--------------------
这个网址里有你想要的答案。
http://www.bhcode.net/article/20080910/2384.html
------解决方案--------------------
setCookie("username","zhangsan",mktime()+3600*24,"/"); 
试试
------解决方案--------------------
对呀 time()函数得到的是字符串~~~
------解决方案--------------------
setCookie("username",serialize("zhangsan"),time()+3600*24,"/");

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