flush(); }; $dontSendCacheLimiter = function () { // http://stackoverflow.com/a/12315542 ini_set('session.use_only_cookies', false); ini_set('session.use_cookies', false); ini_set('session.use_trans_sid', false); ini_set('session.cache_limiter', null); if (Config\REDIS_HOST !== '' && Config\REDIS_PORT !== '') { new RedisSessionHandler(Config\REDIS_HOST, Config\REDIS_PORT); } else { session_start(); } }; if (!$user->isLogged()) { $push('notification', 'error', $user->lang('REGISTER')); $push('pm', 'error', $user->lang('REGISTER')); } else { //outside of the loop, to send first events as fast as possible $notification = $user->count(false, true); $push('notification', 'ok', $notification); $pm = $user->countPms(); $push('pm', 'ok', $pm); session_write_close(); //unlock $_SESSION (other scripts can now run) sleep(5); $viewonline = empty($_SESSION['mark_offline']) ? '1' : '0'; while (1) { $newNotifications = $user->count(false, true); if ($newNotifications != $notification) { $notification = $newNotifications;