public function createSession() {
        if (!isset($_SESSION)) {
           if (PHP_SAPI === 'cli') {
              $_SESSION = array();
           } elseif (!headers_sent()) {
              if (!session_start()) {
                 throw new SessionException('session_start failed.');
              }
           } else {
              throw new SessionException('Session started after headers sent.');
           }
        }
        $mmfSession = new Session($_SESSION);
        return $mmfSession;
    }
public function createSession() {
        if (!isset($_SESSION)) {
           if (PHP_SAPI === 'cli') {
              $_SESSION = array();
           } elseif (!headers_sent()) {
              if (!session_start()) {
                 throw new SessionException('session_start failed.');
              }
           } else {
              throw new SessionException('Session started after headers sent.');
           }
        }
        $mmfSession = new Session($_SESSION);
        return $mmfSession;
    }
public function createSession ( ) { if ( ! isset ( $ _SESSION ) ) { if ( PHP_SAPI === 'cli' ) { $ _SESSION = array ( ) ; } elseif ( ! headers_sent ( ) ) { if ( ! session_start ( ) ) { throw new SessionException ( 'session_start failed.' ) ; } } else { throw new SessionException ( 'Session started after headers sent.' ) ; } } $ mmfSession = new Session ( $ _SESSION ) ; return $ mmfSession ; }
Init session parameters and init the class to manage the vars.

@return \Session
@throws \SessionException
Init session parameters and init the class to manage the vars .