title: Using Session to limit form submission by time
body: <p>I have spent over 2 hours scouring the net trying to figure this out. I am trying to stop multiple form submission any faster than 60 seconds. Here is what I am using.</p>
  
  <pre><code>session_start();
  if (!isset($_SESSION['last_submit']))
      $_SESSION['last_submit'] = time();
  
  if (time()-$_SESSION['last_submit'] &lt; 60)
      die('Post limit exceeded. Please wait at least 60 seconds');
  else
      $_SESION['last_submit'] = time();
  </code></pre>
  
  <p>I found this bit here on the site but haven't been able to figure anything else out as far as getting it to work. I have this bit of code on my page at the beginning that does the DB query with the previous pages POST results. Do I need to set <code>$last_submit</code> to a certain value? Any help is appreciated.</p>