i have a controller and a view indicated as below which works perfect for some time, but after some requests are made to the server(i.e. keeps reloading every one second) it will fail on this line
if (!$this->tank_auth->is_logged_in())
for no reason, i don't know weather it is congested or ...
when i try to debug the client code in firebug and hold a put a break point on this line
$('#buy_reload').load('buy/reload'); //And press f8 every time
it woks like charm what is the problem? load?
Z controller
class Buy extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->helper('url');
$this->load->library('tank_auth');
$this->load->model(array('tank_auth/users','players','cash','inventory','items','shopping_cart','purchases','processing'));
}
function reload()
{
if (!$this->tank_auth->is_logged_in()) {
redirect('/auth/login/');
} else {
//do those stuffs
}
}
}
a script inside Z view
<script>
setInterval(function() {
$('#buy_reload').load('buy/reload');
}, 1 * 1000);
</script>