日期:2014-05-17  浏览次数:20452 次

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,"/");