A
A
artem782017-01-08 00:14:47
PHP
artem78, 2017-01-08 00:14:47

What's the difference between CURLOPT_COOKIEFILE and CURLOPT_COOKIEJAR in curl?

What's the Difference

curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
from curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);?
As much as I write in PHP, I always use both instructions together and did not even think about the difference between them.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2017-01-08
@artem78

CURLOPT_COOKIEJAR - файл, куда пишутся куки после закрытия коннекта, например после curl_close()
CURLOPT_COOKIEFILE - файл, откуда читаются куки.
Так что используйте оба параметра, не ошибетесь.
Но вообще документация - сильная штука.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question