public static function start($lifetime = 0, $path = '/', $domain = null, $httpOnly = true, $secure = false)
    {
        if (!self::$_initialized) {
            if (!is_object(Symphony::Database()) || !Symphony::Database()->isConnected()) {
                return false;
            }

            if (session_id() == '') {
                ini_set('session.use_trans_sid', '0');
                ini_set('session.use_strict_mode', '1');
                ini_set('session.use_only_cookies', '1');
                ini_set('session.gc_maxlifetime', $lifetime);
                ini_set('session.gc_probability', '1');
                ini_set('session.gc_divisor', Symphony::Configuration()->get('session_gc_divisor', 'symphony'));
            }

            session_set_save_handler(
                array('Session', 'open'),
                array('Session', 'close'),
                array('Session', 'read'),
                array('Session', 'write'),
                array('Session', 'destroy'),
                array('Session', 'gc')
            );

            session_set_cookie_params(
                $lifetime,
                static::createCookieSafePath($path),
                ($domain ? $domain : self::getDomain()),
                $secure,
                $httpOnly
            );
            session_cache_limiter('');

            if (session_id() == '') {
                if (headers_sent()) {
                    throw new Exception('Headers already sent. Cannot start session.');
                }

                register_shutdown_function('session_write_close');
                session_start();
            }

            self::$_initialized = true;
        }

        return session_id();
    }