Home  >  Article  >  Backend Development  >  cookie本地可以保留很久,下传到万网主机不行

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

WBOY
WBOYOriginal
2016-06-13 10:45:10825browse

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);


判断语句

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->if(isset($_COOKIE['member']))


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