title: AJAX function on button click not running PHP after the first time
body: <p>I have the following function on a button:</p>
  
  <pre><code>$(function() {
      $("#submit").click(function(){
          $.ajaxSetup({ cache: false });
          $.ajax({
          url:'crfile.php',
          type:'GET',
      });
  };
  </code></pre>
  
  <p>It calls the following PHP file:</p>
  
  <pre><code>if (session_status() == PHP_SESSION_ACTIVE){
      session_destroy();
  }
  session_start();
  
  $extension = ".txt";
  $_SESSION['fname'] = substr(md5(rand()), 0, 7).$extension;
  fopen("temp/" . $_SESSION['fname'], 'w');
  $fname = $_SESSION['fname'];
  </code></pre>
  
  <p>It creates a file with a random name in the temp/ folder. Both are working properly <em>except</em> when I click the <code>#submit</code> button a second time without reloading the page. It reruns the function, however it doesn't generate a new filename in the PHP script.</p>
  
  <p>I thought it was cache or sessions, however neither is the case. I am using PHP 5.5.</p>
  
  <p>Can someone please advise?</p>