Cookie名称不能包含以下任何内容

时间:2015-08-04 20:37:58

标签: php curl cookies

我很抱歉我的英语。我使用谷歌翻译。

我有一个关于php的问题。即使用CURL。

当您尝试带来COOKIE错误时:

Warning: Cookie names can not contain any of the following '= ,; \ t \ r \ n \ 013 \ 014 'in /var/www/test2.lo/app/mvc/controllers/index.php on line 62

我的代码:

curl_setopt ($curl, CURLOPT_COOKIE, $cookies);

决定检查变量我做了以下事情:

var_dump ($cookies);

我很惊讶。但我收到了一个字符串(37)" user_id = 61294582; sid = 6079823296354752"

出了什么样的错误?如何解决?

1 个答案:

答案 0 :(得分:6)

cookie对象的实际名称不能包含任何这些字符。

示例:

cookie名称

cookie = name

饼干;名称

饼干,名称

这些都很糟糕,会给你一个错误。

请删除任何空格,回车符和非打印字符,以及任何等号,逗号或分号。

相关问题