Home > Backend Development > PHP Tutorial > PHP CURL cookies

PHP CURL cookies

WBOY
Release: 2016-06-23 13:24:29
Original
1133 people have browsed it

php的curl扩展,在手册中有示例。先把cookie保存到一个文件,然后在curl中引用这个文件就可以了。
取cookie的参数是:

curl_setopt ( $ch, CURLOPT_COOKIESESSION, true );
curl_setopt ( $ch, CURLOPT_COOKIEJAR, $cookieFile);

发送cookie的关键是:
curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookieFile);

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