Home > Chỉ dẫn lập trình > CURLOPT_COOKIEFILE vs CURLOPT_COOKIEJAR

CURLOPT_COOKIEFILE vs CURLOPT_COOKIEJAR

February 7th, 2010 Leave a comment Go to comments

CURLOPT_COOKIEFILE: The name of the file containing the cookie data. The cookie file can be in Netscape format, or just plain HTTP-style headers dumped into a file.
CURLOPT_COOKIEJAR: The name of a file to save all internal cookies to when the connection closes.

# Sẽ lấy cookie có trong file để gửi request đi
curl_setopt($curl, CURLOPT_COOKIEFILE, ‘cookie_will_be_used.txt’);

# Sẽ lưu cookie server response về
curl_setopt($curl, CURLOPT_COOKIEJAR, ‘cookie_will_be_saved.txt’);

Categories: Chỉ dẫn lập trình Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.
Content (You can use Yahoo! Messenger Emoticons :D = smile)
Captcha