Sparkle THttpClient and working with Cookies

can we have something / helperfunctions or i.e. CookieManager component for better and simplier managing cookie reads and setting of them. Something like tidCookieManager what Indy has?

What exactly features/operations you miss the most? Because cookies can be set and managed directly by reading/writing the HTTP headers.

  • Adding cookies with comprehensive field options including domain, flags, path, security, expiration date, name, value, etc.
  • Method to check if a cookie exists (vNameofCookie): boolean
  • Retrieving cookie information (vNameofCookie): record??
  • Automatic detection of changes in cookies from the request to the response, possibly through an event mechanism.
  • Loading cookies from a string, similar to the format used in CURL cookie files.

Can you please elaborate on these?

Hi Wagner,

When we create a request and receive a response with certain cookies, we save these cookies, for example, into a string. The subsequent request then utilizes these cookies from the previous response.

Therefore, we are using the same cookies across different requests. However, it's possible that the servers may change some of these cookies to new values. In such cases, we want to be notified, for instance, through an event, so that we can react accordingly.

Currently, while this functionality is achievable, we need to integrate the logic ourselves. It would greatly benefit us if your component could handle all of this automatically.

1 Like

Ok, I changed this topic to a feature request.

1 Like