PHP_Cooikes不同页面无法传递怎么处理

WBOY
Release: 2016-06-13 11:50:10
Original
962 people have browsed it

PHP_Cooikes不同页面无法传递怎么办
PHP_Cooikes不同页面无法传递的解决方法。
刚开始设置的cookies

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


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

所以改了一下 就可以了 就是后面加个路径:
setcookie("QQ_access_token",$_SESSION['access_token'],time()+3600*24*90,"/");
Copy after login

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!