static function init() { if (!empty($_REQUEST['no_session'])) { fn_define('NO_SESSION', true); } if (!defined('NO_SESSION')) { Session::set_params(); Session::set_handlers(); Session::start(); // we don't need to register shutdown function if it is ajax request, // because ajax request session manipulations are done in ob_handler. // ajax ob_handlers are lauched AFTER session_close so all session changes by ajax // will be unsaved. // so we call session_write_close() directly in our ajax ob_handler if (!defined('AJAX_REQUEST')) { register_shutdown_function('session_write_close'); } return true; } return false; }