Ok, here is the problem.
I have a facebook application where users can earn points for completing surveys. When the user has completed the survey, at the end of the survey a tracking pixel is fired to credit the users account. The pixel loads a script like the one below:
http://www.mysite.com/fb/add-credit.php?userid=<fbid>
I want to secure this from outside access. I have thought about using referrers, but someone could easily sniff the traffic, and fake the referrer.
I also thought about this. When the user clicks the link to complete the survey I will create an entry in the database with a MD5 timestamp as the token. If the user was to then try and credit their own account by going direct to the add-credit script they would need to know the exact timestamp.
Would there be any issues with the second solution?