Every time a certain form in a site dashboard loads, I generate a unique ID and store it into the database, when the form is submitted I mark the ID as “used” and don’t allow to submit forms which are already used.
Question: Is it worth to store date/time of form load and remove unique IDs say two weeks old?
Or to keep this data in MySQL forever?
I think saving timestamp and clearing out old dara is an excellent idea.
Without that, your web site is not scalable. In fact it could be attacked by repeatedly loading the page and filling your database’s disk to capacity, effectively killing your site.