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();
    }
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();
    }
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 ( ) ; }
Starts a Session object, only if one doesn't already exist. This function maps
the Session Handler functions to this classes methods by reading the default
information from the PHP ini file.

@link http://php.net/manual/en/function.session-set-save-handler.php
@link http://php.net/manual/en/function.session-set-cookie-params.php
@param integer $lifetime
How long a Session is valid for, by default this is 0, which means it
never expires
@param string $path
The path the cookie is valid for on the domain
@param string $domain
The domain this cookie is valid for
@param boolean $httpOnly
Whether this cookie can be read by Javascript. By default the cookie
cannot be read by Javascript
@param boolean $secure
Whether this cookie should only be sent on secure servers. By default this is
false, which means the cookie can be sent over HTTP and HTTPS
@throws Exception
@return string|boolean
Returns the Session ID on success, or false on error.
Starts a Session object only if one doesn t already exist . This function maps the Session Handler functions to this classes methods by reading the default information from the PHP ini file .