How to stop double clicks registering in a SQL update
I have a banner server where an end user clicks on a banner, the link goes to my redirect script CLK.CFM, this page records the click through into the SQL dbase and then it has a CFLOCATION to redirect the user to the appropriate web site.
The problem I am seeing is that when there is a delay from the 3rd party site that the end user is clicking multiple times and it's actually recording multiple clicks in the database
I tried writing some simple code where the page that displays the banner sets a session variable, session.click="1", then when they hit the CLK page I check for the value of session.click, if it's empty I don't SQL update, just go straight to the CFLOCATION, but if there is a value of 1 I update the database and then I set session.click as empty, so in theory only one click should ever record, but even with the longest delay the CFLOCATION will still do it's thing.
Yet after all that, I still see the multiple clicks, and the timestamp shows they happen within a second or or less of each other, so it's definately a multiple press.
Anybody have any idea why my approach above might not work and what I should do to stop this?
Thanks
Mark
