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.

AW: Get cookies for specific URL

From: Hölzl, Dominik via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 25 Sep 2019 07:07:09 +0000

> -----Ursprüngliche Nachricht-----

> Von: Daniel Stenberg <daniel_at_haxx.se<mailto:daniel_at_haxx.se>>

> Gesendet: Dienstag, 24. September 2019 17:28

> An: Hölzl, Dominik <Dominik.Hoelzl_at_fabasoft.com<mailto:Dominik.Hoelzl_at_fabasoft.com>>

> Betreff: Re: AW: Get cookies for specific URL

>

> On Tue, 24 Sep 2019, Hölzl, Dominik wrote:

>

> > Thank you!

>

> Please don't take discussions off-list.

Sorry for that, I just hit the answere button in my mail client, and I don't use mailing lists that often.

>

> > What I would need is passing an URL and that HTTPOnly-cookies should

> > be retrieved and getting the appropriate cookie names and values

> > (Mainly what InternetGetCookieEx does).

>

> I have exactly zero ideas what InternetGetCookieEx does! =)

>

> > For now I will go with external matching, as you say the missing

> > domain isn't an issue for what I need it. It would only be nice to

> > have an API as the code is already there but cannot be used now in

> > that

> way.

>

> Well, if you who have a use case, can easily work around it and not

> work on a API then perhaps the need isn't that big...

>

> --

>

> / daniel.haxx.se

With InternetGetCookieEx you can specify an URL and a cookie name and a flag if it should also return HTTPOnly cookies, and it will return the appropriate cookie value from the cookie store as it would be sent to the specified URL when a request would be issued.

When I peform a request with cURL and the server responds with a Set-Cookie instruction, the cookie will be put into the CURLSH's cookie store. And after this I would like to read a specific cookie matching the respective URL (and path).

With the currently available API I could either catch the Set-Cookie headers, or use CURLINFO_COOKIELIST and check if the cookies matches the given URL, path, etc. (removeexpired, tailmatch, pathmatch, ..).

For security and maintenance reasons it just would be nice to have one single code for that.

Regards,

Dominik

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