fix vars and cookie set

Update hook to use correct vars from hook, change hook used to set affiliate cookie when adding or removing codes, use new WHMCS cookie class