CURLSMBS Cookies

Wondering if anyone has any experience getting cookies from CURLSMBS.

I have connected to a site via CURLSMBS.Perform. I can retrieve the HTML response with CURLSMBS.OutputData, but I’d like to get the response header info so I can parse out the cookies, save them to disk, and submit them in future transactions to the same server. Can CURLSMBS pull these cookies out automatically for me, and/or is there a way to access the Response headers directly?

I’ve tried messing with .OptionCookieList as cited in the docs but it always returns a 0 length list even though I know cookies are being sent by the server.

Thanks in advance for any suggestions.

Try assigning an empty string to the OptionCookieFile property. This should enable the cookie features.

1 Like

Yes, we usually put in the cookie jar/file.

e.g.

// Activate cookie engine without cookie file:
curl.OptionCookieJar = ""

this will collect cookies in memory and use them for further requests.
So if you use the same CURLSMBS object, it would get the cookie in a login request and then include the cookie for future requests.

Thanks! Just for clarity, how does one manually read the response headers as well? Nevermind, found it in .HeaderData. Thanks again!

1 Like