D
D
Dmitry Grebenshchikov2014-11-13 20:17:29
PHP
Dmitry Grebenshchikov, 2014-11-13 20:17:29

How to write cookie parameter from curl?

Good evening. I can't make sense at all.
I'm trying to make friends with the API for ordering a taxi.
Authorization is a normal request like:
localhost:8080/WebAPI/Login?app=CxTaxiWebAPI&k=***
Where k is the API key
. The response is a JSON object of the form:

"success": true,
"idClient": <Идентификатор клиента (Int64)>, "params": <Параметры системы>, "sessionid": <Идентификатор сессии> }

Further, all work is based on the sessionid stuffed in the cookie.
Expert question: I get this sessionid by sending a curl request. How to cram it into a cookie for half an hour and work with the system?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2014-11-13
@iMeath

curl_setopt(ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt(ch, CURLOPT_COOKIEJAR, $cookie_file);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question