PHP - Is this a good method to prevent re-submission?
<p>This is related to preventing <a href="http://stackoverflow.com/questions/542284/preventing-webform-resubmission-on-browser-refresh-without-losing-viewstate">webform resubmission</a>, however this time the context is a web-based RPG. After the player defeats a monster, it would drop an item. So I would want to prevent the user from hitting the back button, or keep refreshing, to 'dupe' the item-drop.</p>

<p>As item drop is frequent, using a DB to store a unique 'drop-transaction-id' seems infeasible to me. I am entertaining an idea below:</p>

<ol>
<li><p>For each combat, creating an unique value based on the current date-time, user's id and store it into DB and session. It is possible that given a userid, you can fetch the value back </p></li>
<li><p>If the value from session exists in the DB, then the 'combat' is valid and allow the user to access all pages relevant to combat. If it does not exist in DB, then a new combat state is started</p></li>
<li><p>When combat is over, the unique value is cleared from DB.</p></li>
<li><p>Values which is 30mins old in the DB are purged.</p></li>
</ol>

<p>Any opinions, improvements, or pitfalls to this method are welcomed</p>
