PHP and cURL cookies

I am trying to set up a php page that uses cURL to access a third-party server for login. Now my code successfully logs on to a third-party server, but since cURL does not send SESSION cookies to the user, it must log in

How can I get cURL to send cookies to the client. Thanks

+1
source share
3 answers

View the documentation for the following cURL options:

CURLOPT_COOKIE
CURLOPT_COOKIEFILE
CURLOPT_COOKIEJAR

EDIT

, , cookie , , . , Same Origin Policy. , cookie OWN- cookie . :

client --CONTACTS--> foo.com --cURL-LOGIN--> bar.com
bar.com --bar.com-COOKIE--> foo.com --foo.com-COOKIE--> client
client --foo.com-COOKIE--> bar.com (Will not work)

, foo.com bar.com!

+4

, , cookie .

PHP- cookie (, Hotmail). ( / ).

, cookie.

+1

cookie , . , , - php- curl-. . . CURLOPT_FOLLOWLOCATION false CURLOPT_HEADER cookie , , ( ":...) (" Set-Cookie:....). , . [post] html, cookie libcurl, .

0
source

Source: https://habr.com/ru/post/1724949/


All Articles