There is such code on jQuery :

setInterval(function(){ $.post('ajax/check_session.php', {zapros:'zap'}, function(session_zap){ if(session_zap == 'no'){ $('#session_false').show(500); $('#session_true').hide(500); $('#a_act').show(700); } else{ $('#session_false').hide(500); $('#session_true').show(500); $('#session_login').text(session_zap); $('#a_act').hide(700); } }); },1000);

I would like to know if it carries a heavy load on the server?

    1 answer 1

    1. As for the banal task of monitoring session completion, a small interrogation interval is too small, and with a large number of clients, yes, it can put an unnecessary load on the server. At least 60-120 seconds.

    2. It is not clear how you will consider the end of the session on the server. With constant hammering, the session can be hypothetically eternal.

    3. setInterval is not gud. Everywhere it is recommended to use setTimeout and re-create it from itself if necessary.

    • Yeah, I get it, thanks. I still have a session deletion check. - k0mar 6:26 pm