Welcome Guest, Not a member yet? Register   Sign In
logout without unsing cron-job
#1

dear friend,
 i want to make function that working are than user can close this broswer ,than after 10 second he logout and his update status  user table column name logout yes, i am try this code...

function logout()
{
............update query...........
.............................
...............................
...........session destoy......
}

<script>
var stinterval;
stinterval=setInterval(unsetsession,5000);
function unsetsession(){
    var url= '<?=base_url('logout1')?>';
    $.get(url,function(data){
       if(data)
       {
        clearInterval(stinterval);
        window.location.reload();
       } 
    });
}
</script>


but in case when browser clode than script are no working
Reply
#2

If the web browser is closed none of your code is going to run.

You can log them out on browser close set this in ./application/config/config.php.

PHP Code:
$config['sess_expiration'] = 0

That tells the browser to close the session on exit.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB