php cookie丢失是因为没有设置过期时间, 过期时间为unix时间戳,其设置语句为“setcookie('name', 'value', time()+3600);”。

推荐:《PHP视频教程》
具体问题:
我现在有一个页面的跳转
setcookie(“name1”,value1); setcookie(“name2”,value2); header(“Location:http:192.168.1.118/b2b2c/qingdao/login);
现在的问题是在跳转之后cookie中的值取不到了,请问一下这是问什么,请各位高手帮忙。
立即学习“PHP免费学习笔记(深入)”;
现在我要跳转的画面是另一个工程中的画面。
解决办法:
没有设置过期时间, 过期时间为unix时间戳
~
eg:
setcookie('name', 'value', time()+3600); //一小时
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号