如果paypal交易成功,如何设置cookie

I have added a Paypal button to my web app using the javascript at:

https://github.com/paypal/JavaScriptButtons

How can I set a cookie if the transaction was successful in Paypal? I have currently set it up so that the return url is passing a value: ?transaction=true but I am just afraid that users can easily inspect the site and change the value of this cookie.

use a session object. users cant change that.