title: Updating $_SESSION variables using Ajax
body: <p>On my main page I assign four different $_SESSION variables as follows:-</p>
  
  <pre><code>    &lt;p class="p-wht space left"&gt;Working: &lt;? echo $_SESSION['Working'] ?&gt;&lt;/p&gt;
      &lt;p class="p-wht green space left"&gt;Clear: &lt;? echo $_SESSION['Clear'] ?&gt;&lt;/p&gt;
      &lt;p class="p-wht red space left"&gt;Busy: &lt;? echo $_SESSION['Busy'] ?&gt;&lt;/p&gt;
      &lt;p class="p-wht cyan space left"&gt;STC: &lt;? echo $_SESSION['STC'] ?&gt;&lt;/p&gt;
  </code></pre>
  
  <p>These are set when the page loads:-</p>
  
  <p><code>include('status.controller.php');</code></p>
  
  <p>and they are set as:</p>
  
  <pre><code>            $_SESSION['Working'] = $status['Working'];
              $_SESSION['Clear'] = $status['Clear'];
              $_SESSION['Busy'] = $status['Busy'];
              $_SESSION['STC'] = $status['STC'];
  </code></pre>
  
  <p>They update when the page is refreshed or first loaded, but when I am trying to update them using AJAX the values don't seem to be changing.</p>
  
  <p>I have tried:-</p>
  
  <pre><code>$(function(){
  setInterval(function(){
      $.ajax({
          url:'scripts/php/status.controller.php',
          success:function(data){
              if(data == "scripts/php/status.controller.php"){
              }else{
                  alert(data);
                  //location.reload();
          }
          }
      });
  },4000);
  });
  </code></pre>
  
  <p>but this doesn't seem to update the values. It only updates the values when the page is completely reloaded, including <code>location.reload();</code> which I don't want to use.</p>
  
  <p>Any ideas?</p>
  
  <p>ADDED; contents of status.controller.php file; here is the contents of this file; nathandasilva.co.uk/status.controller.txt</p>