Questions about saving cookies in curl

Source: Internet
Author: User
Curl: the COOKIE is saved. Some websites use different domain names to set cookies. Therefore, CURL may miss some cookies. For example, when CURL accesses the www.xxx.com homepage, it immediately sets a COOKIE belonging to xxx.com. after entering the user name on the homepage, it will go to www.xxx.com/next.php.
Some websites will use different domain names to set cookies, so it seems that CURL will miss some cookies. For example, when CURL accesses the www.xxx.com homepage, it immediately sets a COOKIE of xxx.com. after the user name is set on the homepage, it is transferred to www.xxx.com/next.php. in this case, it sets a cookiethat belongs to www.xxx.com. How can I obtain these two cookies successfully? Curl Cookie domain name shared:
------ Solution --------------------
CURLOPT_COOKIE
Set the content in the "Set-Cookie:" section of the HTTP request.
CURLOPT_COOKIEFILE
The name of the file containing the cookie information. the cookie file can be in Netscape format or HTTP header information.
CURLOPT_COOKIEJAR
Name of the file that stores cookie information after the connection is closed

------ Solution --------------------
The actual situation should be analyzed in detail. you 'd better give a real url
------ Solution --------------------
No difference

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.