cookie为啥设置失败

WBOY
Release: 2016-06-13 11:25:51
Original
1002 people have browsed it

cookie为什么设置失败?
我有这样一段程序:
if(setcookie('me','mycookie'))
{
echo "cookie已设置";
}
echo "已登录";

运行结果是"已登录”是有的,但"cookie已设置“没有显示。这说明cookie设置失败了。

请问我这一段程序为什么会设置失败呢?有语法错误吗?失败的原因可能是什么?(我的浏览器支持cookie)

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!