cookie本地可以保留很久,下传到万网主机不行

WBOY
Release: 2016-06-13 13:17:56
Original
841 people have browsed it

cookie本地可以保留很久,上传到万网主机不行
cookie本地可以保留很久,上传到万网主机不行

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
$expire=time()+360000000;
setcookie('member[userID]',$userid,$expire);
setcookie('member[username]',$username,$expire);
setcookie('member[password]',$password,$expire);
setcookie('member[groupName]',urlencode($groupName),$expire);
setcookie('member[groupID]',$groupID,$expire);


Copy after login


判断语句

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->if(isset($_COOKIE['member']))
Copy after login


------解决方案--------------------
1.把cookie中的内容写数据库或是文件
2.把cookie中的内容存入session中
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!