How To Set A Custom Cookie When A Product Is Added To Cart

[color=#282828][font=arial, verdana, tahoma, sans-serif]What’s the best way to set a cookie using [/font][/color]fn_set_cookie() function when the product is added to the cart using PHP hooks? I’m using CS-Cart 4.0.3. Thanks!