read data returned from jquery .post
<p>I have a page that I want redirected to the login page if a user is inactive for 1/2 hour. I am new to jQuery and it has taken me awhile to get this far. 
So basically the user logs in they are redirected to the home page. I have jQuery running on the home page that posts to the check_time.php page every 10 seconds. if they have been inactive for more than a 1/2 hour, then session is destroyed and they get redirected to the login page. 
I have everything working except checking the value of the "data" that is returned from the check_time.php page.</p>

<p>here is the code on the home page. </p>

<pre><code>ini_set('session.gc_maxlifetime',1800);
ini_set('session.gc_probability',1);
ini_set('session.gc_divisor',1); 
session_start();
if($_SESSION['admin_login'] != $password){
    header('Location: index.php'); 
    exit();
}
if(isset($_SESSION['last_activity']) &amp;&amp; (time()-$_SESSION['last_activity'] &gt;1800)){
// last request was more than 30 minates ago
session_destroy();   // destroy session data in storage
session_unset();     // unset $_SESSION variable for the runtime
    header('Location: index.php'); 
    exit();
}
$_SESSION['last_activity'] = time(); // update last activity time stamp
?&gt;


&lt;script src="jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;     

function timedCount(){        
    $.ajax({
      type: 'POST',
      url: "check_time.php",
      success: function(data){
        if (data == "LOGOUT") {
    window.location = 'index.php';
        }
}
});
setTimeout("timedCount()",10000);
 };

&lt;/script&gt;
</code></pre>

<p>this is the code on the check_time.php</p>

<pre><code>&lt;?php

  session_start();
    if (isset($_SESSION['last_activity'])){
        if(time() - $_SESSION['last_activity'] &gt; 1800){
            session_unset();
            session_destroy();
            echo "LOGOUT";  
        }
    }else{
        echo "LOGOUT";
    }
?&gt;
</code></pre>

<p>I asked this same question last week I wanted to post my latest code so I stated a new question.  I really greatly appreciate your help!!!!!</p>
