How does php curl set up cookie
Php curl how to set up cookie, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
Php curl sets cookie method: 1, create PHP sample file; 2, set cURL transmission options through curl_setopt function; 3, pass cookie in CURL.
This article operating environment: Windows7 system, PHP7.1 version, DELL G3 computer.
How does php curl set up cookie?
The method and steps of passing cookie in PHP CURL
How do I use curl's cookie? Beginners are very headache, curl parameters are too many, of which the cookie part involves 4.
Of course, it is clearly stated in the manual that there are three cookie for curl, but there is also a parameter for header, which can include cookie.
Curl is very easy to use. The most important thing is to be familiar with the use of curl_setopt.
Curl_setopt ($ch, CURLOPT_COOKIE, $cookie)
The cookie value here should be used; separate, not with &. There is no need to use urlencode coding, of course, coding is better.
$cookie = "axibacteric caterpillar name = Fang Shiyu"
Note that when using this, not curl_setopt ($ch, CURLOPT_HTTPHEADER, $header)
The $header of contains the Cookie parameter, otherwise it will overlap, resulting in an unforeseen situation in the cookie.