How to set cookie after payment and trial on pro-sites

I want to set TEST_COOKIE after pro sites signup and payment done, or signup as a trial. How can I achieve this?