curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Edit cookies easily?

From: Rainer Canavan via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 22 May 2019 11:43:27 +0200

On Tue, May 21, 2019 at 10:45 PM Scott Ellentuch via curl-library
<curl-library_at_cool.haxx.se> wrote:
>
> Hi,
>
> Using PHP and curl_init/curl_setopt/curl_exec/curl_close.
>
> My need is that I contact A.example.com, perform a login transaction there,
> and then use the cookies returned for contacting B.anotherexample.com to continue the transaction. Cookies are scoped to the FQDN.
>
> I could do the first bit, close up shop, readin/edit/write the cookie file, then do my second bit, but that seems SO crude. ;)
>
> Is there a way to cleanly either tell the program to ignore cookie domains completely or be able to gracefully edit the cookie domain without all the extra overhead?

There's a user contributed note about using (reading / altering) the
curl in-memory cookie jar in the php documentation for curl_setopt():

https://www.php.net/manual/de/function.curl-setopt.php#118967

If that doesn't work for you, you can bypass the entire curl cookie
handling by reading the incoming Cookies from the response headers,
and setting them again as request headers for the next request.

rainer
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-05-22