Is there something in php equivalent to CookieContainer in Asp. Net? In Asp. Net, the following functions can be used to access the page. postData is the data that requires the Post of the specified url:
Public string getHtml (string url, CookieContainer cookie, byte [] postData );
How to implement it in php? Can it be written like this?
Are there any of the following statements?
Curl_setopt ($ ch, CURLOPT_COOKIEJAR, $ tmpFile );
Curl_setopt ($ ch, CURLOPT_COOKIEFILE, $ tmpFile );
Can only use temporary files? Are there other improvement methods? O (∩ _ ∩) O thank you ~~~~~~
Reply to discussion (solution)
CURLOPT_COOKIEJAR is used to save the cookie to the file when the connection is closed.
CURLOPT_COOKIEFILE is used to send the cookie in the file during connection.
CURLOPT_COOKIE is used to send the cookie in the variable during connection.
Whether it is required or not depends on your application scenario.
Save to file is the default action
You can set CURLOPT_READFUNCTION to process it with your own function.
Thank you for your guidance ~~~