Initiate a TLS (encrypted) session.
@access public
@return boolean
425302
public function startTLS()
    {
        if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
            return false;
        }
        // Begin encrypted connection
        if (!stream_socket_enable_crypto(
            $this->smtp_conn,
            true,
            STREAM_CRYPTO_METHOD_TLS_CLIENT
        )) {
            return false;
        }
        return true;
    }
1220885
public function initSession()
    {
        if (php_sapi_name() != 'cli') {
        
            if (!isset($_COOKIE['ccms'])) {
                $this->_uid = md5($_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT'].rand());
            } else {
                $a = explode('.', $_COOKIE['ccms']);
                $this->_uid = $a[0];
                $this->_last_visit = $a[1];
            }
            setcookie('ccms',$this->_uid.'.'.time(),time()+REMEMBER_ME_SECONDS,'/');
            
        }
        
        \Zend_Session::setSaveHandler(new SessionSaveHandler());
                             
        $this->_session = new \Zend_Session_Namespace(SESSION_NAMESPACE);
        
        if (isset($this->_session->locale) && $this->_session->locale) {
            $this->_locale->setLocale($this->_session->locale);
        }
    }
716599
public function start(): bool
    {
        if (!is_null($this->expiration)) {
            $this->expiration->start();
        }
        if (!is_null($this->fingerprint)) {
            $this->fingerprint->start();
        }
        if (!isset($_SESSION['__HANDLER_INITIATED'])) {
            return $this->initialSessionStart();
        } else {
            return $this->laterSessionStart();
        }
    }
779637
private function __init()
    {
        $this->_session = Session::start($this->_timeout, $this->_path, $this->_domain, $this->_httpOnly, $this->_secure);

        if (!$this->_session) {
            return false;
        }

        if (!isset($_SESSION[$this->_index])) {
            $_SESSION[$this->_index] = array();
        }

        // Class FrontendPage uses $_COOKIE directly (inside it's __buildPage() function), so try to emulate it.
        // @deprecated will be removed in Symphony 3.0.0
        $_COOKIE[$this->_index] = &$_SESSION[$this->_index];

        return $this->_session;
    }
1019524
protected function _start()
	{
		// Start session if not started
		if ($this->state === 'restart')
		{
			session_regenerate_id(true);
		}
		else
		{
			$session_name = session_name();

			// Get the JInputCookie object
			$cookie = $this->input->cookie;

			if (is_null($cookie->get($session_name)))
			{
				$session_clean = $this->input->get($session_name, false, 'string');

				if ($session_clean)
				{
					session_id($session_clean);
					$cookie->set($session_name, '', time() - 3600);
				}
			}
		}

		/**
		 * Write and Close handlers are called after destructing objects since PHP 5.0.5.
		 * Thus destructors can use sessions but session handler can't use objects.
		 * So we are moving session closure before destructing objects.
		 *
		 * Replace with session_register_shutdown() when dropping compatibility with PHP 5.3
		 */
		register_shutdown_function('session_write_close');

		session_cache_limiter('none');
		session_start();

		return true;
	}
1081063
public function session_init()
    {
        // session started (Installer?)
        if (session_id()) {
            return;
        }

        $sess_name   = $this->config->get('session_name');
        $sess_domain = $this->config->get('session_domain');
        $sess_path   = $this->config->get('session_path');
        $lifetime    = $this->config->get('session_lifetime', 0) * 60;
        $is_secure   = $this->config->get('use_https') || rcube_utils::https_check();

        // set session domain
        if ($sess_domain) {
            ini_set('session.cookie_domain', $sess_domain);
        }
        // set session path
        if ($sess_path) {
            ini_set('session.cookie_path', $sess_path);
        }
        // set session garbage collecting time according to session_lifetime
        if ($lifetime) {
            ini_set('session.gc_maxlifetime', $lifetime * 2);
        }

        // set session cookie lifetime so it never expires (#5961)
        ini_set('session.cookie_lifetime', 0);
        ini_set('session.cookie_secure', $is_secure);
        ini_set('session.name', $sess_name ?: 'roundcube_sessid');
        ini_set('session.use_cookies', 1);
        ini_set('session.use_only_cookies', 1);
        ini_set('session.cookie_httponly', 1);

        // get session driver instance
        $this->session = rcube_session::factory($this->config);
        $this->session->register_gc_handler(array($this, 'gc'));

        // start PHP session (if not in CLI mode)
        if ($_SERVER['REMOTE_ADDR']) {
            $this->session->start();
        }
    }
931529
public function startSession()
  {
    if ($this->sessionState == self::SESSION_NOT_STARTED && !headers_sent()) {
      $this->sessionState = session_start();
    }
    return $this->sessionState;
  }
824709
private function _start()
	{
		if ($this->_state === self::STATE_RESTART) {
			session_id($this->_createId());
		}

		session_cache_limiter('none');

		return session_start();
	}
315057
public function connect(): bool
	{
		if ($this->ssl === true)
		{
			$this->connection = fsockopen('ssl://'.$this->host, $this->port);
		}
		else
		{
			$this->connection = fsockopen($this->host, $this->port);
		}

		return $this->connected();
	}
1279745
private function startSession()
  {
    if (Config::has('session') && is_array($session = Config::get('session'))) {
      return session_start($session);
    }

    session_start([
      'name' => 'modulus_session'
    ]);
  }
1322007
private function hasSession() {

        if(DI::getDefault()->has('session') === true) {

            // get instance of session class
            $this->session = DI::getDefault()->getSession();

            if($this->session->getId() === '') {
                $this->session->start();
            }

            return true;
        }

        return false;
    }
683115
public function start()
    {
        if ($this->isSessionStarted()) {
            return;
        }

        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        if ($this->isAdmin()) {
            $this->setName("admin_sid");
        } else {
            $this->setName("sid");
        }

        $sid = $this->getSidFromRequest();

        //starting session if only we can
        if ($this->_allowSessionStart()) {
            //creating new sid
            if (!$sid) {
                self::$_blIsNewSession = true;
                $this->initNewSession();
            } else {
                self::$_blIsNewSession = false;
                $this->_setSessionId($sid);
                $this->_sessionStart();
            }

            //special handling for new ZP cluster session, as in that case session_start() regenerates id
            if ($this->_sId != session_id()) {
                $this->_setSessionId(session_id());
            }

            //checking for swapped client
            $blSwapped = $this->_isSwappedClient();
            if (!self::$_blIsNewSession && $blSwapped) {
                $this->initNewSession();

                // passing notification about session problems
                if ($this->_sErrorMsg && $myConfig->getConfigParam('iDebug')) {
                    \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay(oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, $this->_sErrorMsg));
                }
            } elseif (!$blSwapped) {
                // transferring cookies between hosts
                \OxidEsales\Eshop\Core\Registry::getUtilsServer()->loadSessionCookies();
            }
        }
    }
19992
protected function loadSession()
    {
        if (session_id() === '') {
            session_start();
        }

        $value = \Slim\Http\Util::decodeSecureCookie(
            $this->app->request()->cookies($this->settings['name']),
            $this->settings['secret'],
            $this->settings['cipher'],
            $this->settings['cipher_mode']
        );
        if ($value) {
            $_SESSION = unserialize($value);
        } else {
            $_SESSION = array();
        }
    }
1070112
public function startSession()
    {
        return (string) $this->sendTransaction([
          'email' => $this->email,
          'token' => $this->token,
        ], $this->url['session'])->id;
    }
789456
protected function initSecureContext()
    {
        if (!\EventUtil::sslRandPoll()) {
            Daemon::$process->log(get_class($this->pool) . ': EventUtil::sslRandPoll failed');
            $this->erroneous = true;
            return;
        }
        if (!FileSystem::checkFileReadable($this->certfile) || !FileSystem::checkFileReadable($this->pkfile)) {
            Daemon::log('Couldn\'t read ' . $this->certfile . ' or ' . $this->pkfile . ' file.  To generate a key' . PHP_EOL
                . 'and self-signed certificate, run' . PHP_EOL
                . '  openssl genrsa -out ' . escapeshellarg($this->pkfile) . ' 2048' . PHP_EOL
                . '  openssl req -new -key ' . escapeshellarg($this->pkfile) . '  -out cert.req' . PHP_EOL
                . '  openssl x509 -req -days 365 -in cert.req -signkey ' . escapeshellarg($this->pkfile) . '  -out ' . escapeshellarg($this->certfile));

            return;
        }
        $params = [
            \EventSslContext::OPT_LOCAL_CERT => $this->certfile,
            \EventSslContext::OPT_LOCAL_PK => $this->pkfile,
            \EventSslContext::OPT_VERIFY_PEER => $this->verifypeer,
            \EventSslContext::OPT_ALLOW_SELF_SIGNED => $this->allowselfsigned,
        ];
        if ($this->passphrase !== null) {
            $params[\EventSslContext::OPT_PASSPHRASE] = $this->passphrase;
        }
        if ($this->verifydepth !== null) {
            $params[\EventSslContext::OPT_VERIFY_DEPTH] = $this->verifydepth;
        }
        if ($this->cafile !== null) {
            $params[\EventSslContext::OPT_CA_FILE] = $this->cafile;
        }
        if ($this->tls === true) {
            $method = \EventSslContext::TLS_SERVER_METHOD;
        } elseif ($this->tls === 'v11') {
            $method = \EventSslContext::TLSv11_SERVER_METHOD;
        } elseif ($this->tls === 'v12') {
            $method = \EventSslContext::TLSv12_SERVER_METHOD;
        } elseif ($this->ssl === 'v3' || $this->ssl === true || $this->ssl === '1') {
            $method = \EventSslContext::SSLv3_SERVER_METHOD;
        } elseif ($this->ssl === 'v2') {
            $method = \EventSslContext::SSLv2_SERVER_METHOD;
        } elseif ($this->ssl === 'v23') {
            $method = \EventSslContext::SSLv23_SERVER_METHOD;
        } elseif ($this->ssl) {
            Daemon::log(get_class($this) . ': unrecognized SSL version \'' . $this->ssl . '\'');
            return;
        } else {
            return;
        }
        $this->ctx = new \EventSslContext($method, $params);
    }
209117
public function openSession(){
        $Login = new services\login\Session( $this);
        $Login->askLoginStatus();
        $Login->createSession();

        $this->permissions   = $Login->getPermissions();
        $this->session_token = $Login->getSessionToken();
    }
746383
public function start(): bool
    {
        if (!$this->started) {
            // check headers
            if (headers_sent($file, $line)) {
                throw new SessionException(sprintf("Cannot use '%s()', headers already sent in %s:%s",
                    __method__, $file, $line));
            }

            // start session
            $this->started = session_start();
            if (!$this->started) {
                session_write_close();
                throw new SessionException(sprintf("Session start failed in '%s()'", __method__));
            }

            // check id for last time
            if (session_id() !== $this->id) {
                session_write_close();
                throw new SessionException(sprintf("Session ID match failed in '%s()'", __method__));
            }

            // init sub-array
            if (!isset($_SESSION[$this->name])) {
                $_SESSION[$this->name] = [];
            }
        }

        return $this->started;
    }