Affiliate system and cookies

Hello fellow CS-Cart users. :slight_smile: I hope someone here is able to help us with this little question.

We are currently playing around with the affiliate system, and trying to find out how it works exactly, on a technical level. We have added a test commission plan for the affiliates (which gives commissions per sale), and wish to find out how an external script could add a cookie on a clients/customers computer. This is what we’ve found out:

When using the shop to place the cookies, a cookie with name “cs_cookies[partner_id]” is created, with the value set to the ID of the affiliate. When proceeding with and finalising checkout, the order has the affiliate commission in the order. If, however, an external script (on the same domain) adds the cookie with the exact same parameters, the order is not associated with the affiliate ID. Then how does the shop keep track of which affiliate ID is associated with the order, the thing(s) we do not do in the external script (yet)?

I hope this is understandable, and that someone will be able to help us. :slight_smile: