snowplow / snowplow-cpp-tracker

Snowplow event tracker for C++. Add analytics to your C++ applications, games and servers
http://snowplowanalytics.com
Apache License 2.0
9 stars 6 forks source link

Add support for storing cookies in HTTP clients (close #78) #79

Closed matus-tomlein closed 2 years ago

matus-tomlein commented 2 years ago

This PR addresses issue #78 and adds support for cookies returned from the collector which enables the network_userid property to be consistent.

The cookie implementation is different for each HTTP client. There are three clients:

  1. The Windows HTTP client already had cookie support by default. So no changes were required there.
  2. The Apple HTTP client was using older APIs that do not have cookie support. I changed the implementation to use the shared NSURLSession as on the iOS tracker which has cookie support by default.
  3. The CURL client used on Linux has optional Cookie support. It can use a local file where to store cookies or use in-memory storage (if the file path is empty). I added a parameter to NetworkConfiguration to configure the cookie path for the CURL client (the parameter is ignored on Windows and macOS).