Home > Backend Development > PHP Tutorial > PHP_Cooikes不同页面无法传递的解决方法_PHP

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

WBOY
Release: 2016-06-01 11:55:15
Original
948 people have browsed it

这是我刚开始设置的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,"/");

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