Home  >  Article  >  Backend Development  >  PHP_Cooikes不同页面无法传递的解决方法_PHP教程

PHP_Cooikes不同页面无法传递的解决方法_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:37:17743browse

这是我刚开始设置的cookies

复制代码 代码如下:

setcookie("QQ_access_token",$_SESSION['access_token'],time()+3600*24*90);

发现到别的页面后无法使用,后来到cookies里面去看看有什么问题,发现cookies是存在的 但是默认的加了服务器的目录

所以改了一下 就可以了 就是后面加个路径
复制代码 代码如下:

setcookie("QQ_access_token",$_SESSION['access_token'],time()+3600*24*90,"/");

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/736783.htmlTechArticle这是我刚开始设置的cookies 复制代码 代码如下: setcookie("QQ_access_token",$_SESSION['access_token'],time()+3600*24*90); 发现到别的页面后无法使用,后来到...
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