Call to a php logout script using jQuery
<p>I want my user to be automatically loged out of the site if there has been no activity for half hour. (Code You see below is set for 70 seconds not 1/2 hour). 
I realize that what I need is to use jQuery ... this I am extremly new to ... to load my php script. (I've been working on this for way too long) This is what I have so far.</p>

<p>This is in the head of my page.
    
    </p>

<pre><code>var log_me_out = true;
setTimeout(function(){

    $.post({
        url: "check_time.php",
        //data: optional, the data you send with your php-script
        success:function(){
            if(log_me_out == 'yes'){
                 window.location = 'index_test.php';
            }
        }
    })
 }, 80000);
&lt;/script&gt;
</code></pre>

<p>This my check_time.php page </p>

<pre><code>&lt;script type="text/javascript"&gt;
var log_me_out = true;
&lt;/script&gt;
&lt;?php
include('pagetoretrivepassword.inc.php');

    session_start();
    if($_SESSION['admin_login'] != $password){ 
        session_unset();
        session_destroy();
        ?&gt;
        &lt;script type="text/javascript"&gt;
         log_me_out = 'yes';
        &lt;/script&gt;
        &lt;?php
    }else{
        ?&gt;
        &lt;script type="text/javascript"&gt;
         log_me_out = 'no';
        &lt;/script&gt;
        &lt;?php
    }

?&gt;
</code></pre>
