Service entry point.

@param string $sessionId The session-Id to use as predefined

@internal param bool $autoInit TRUE to automatically start session, FALSE to do not

@author   Benjamin Carl <opensource@clickalicious.de>
487850
public function __tearup($sessionId = null)
    {
        $configuration = self::getRegistry()->getConfiguration()->session;

        $this
            ->logger(self::getRegistry()->getLogging())
            ->id($sessionId)
            ->clientIp($_SERVER['REMOTE_ADDR'])
            ->userAgent($_SERVER['HTTP_USER_AGENT'])
            ->domain($_SERVER['SERVER_NAME'])
            ->flagStatus('httpOnly', true)
            ->flagStatus('ssl', true);

        if (true === $configuration->autoinit) {
            $this
                ->init($configuration)
                ->start();
        }
    }
813335
private function initialize()
    {
        $this->name = (isset($this->configurations['name']))
            ? $this->configurations['name']
            : self::DEFAULT_SESSION_NAME;
        $this->assignSessionLifetime();
        if (isset($this->configurations['encryption_enabled'])
            && $this->configurations['encryption_enabled']) {
            $this->handler = new EncryptedSessionHandler();
        }
        $this->security = new SecuritySession($this->configurations);
    }
69408
public static function start()
    {
        /*
            session_id() will continue to return id even after session_write_close()
        */
        if (\session_status() === PHP_SESSION_ACTIVE) {
            return true;
        }
        if (\headers_sent()) {
            return false;
        }
        self::setCfg(array());  // makes sure all default's determined and set
        $success = \session_start();
        \bdk\Debug::_info('started', \session_id());
        if (self::$cfgStatic['regenOnStart']) {
            self::regenerateId();
        }
        return $success;
    }
156952
public function run($sessionId = null)
    {
        $this->sessionId = ($sessionId !== null) ? $sessionId : uniqid();

        if (function_exists('pcntl_signal')) {
            pcntl_signal(SIGTERM, [$this, 'signalHandler']);
            pcntl_signal(SIGINT, [$this, 'signalHandler']);
            pcntl_signal(SIGHUP, [$this, 'signalHandler']);
        }

        $this->daemon->start();
    }
873815
public static function init() : void
    {
        if ( ! empty($_SESSION[Notification::SESSION_KEY]) && is_array($_SESSION[Notification::SESSION_KEY])) {
            Notification::$notifications = $_SESSION[Notification::SESSION_KEY];
        }

        $_SESSION[Notification::SESSION_KEY] = [];
    }
947204
public function insert($sessionId, $clientId)
	{
		$this->session_id = $sessionId;
		$this->client_id = $clientId;

		$this->time = time();
		$ret = $this->_db->insertObject($this->_tbl, $this, 'session_id');

		if (!$ret)
		{
			$this->setError(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED', strtolower(get_class($this)), $this->_db->stderr()));

			return false;
		}
		else
		{
			return true;
		}
	}
234919
protected function sessionStart($force_start = true)
    {
        if ($this->sessionStarted) {
            return;
        }
        $this->sessionStarted = true;
        if (!$this instanceof \PHPDaemon\HTTPRequest\Generic) {
            Daemon::log('Called ' . get_class($this) . '(trait \PHPDaemon\Traits\Sessions)->sessionStart() outside of Request. You should use onSessionStart.');
            return;
        }
        $f = true; // hack to avoid a sort of "race condition"
        $this->onSessionStart(function ($event) use (&$f) {
            $f = false;
            $this->wakeup();
        });
        if ($f) {
            $this->sleep($this->sessionStartTimeout);
        }
    }
1192973
public function createPHPSession($sessionID = true)
    {
        if ($sessionID) {
            $_SESSION[$this->_sessionName] = $this->_session;
        }
        return $this;
    }
1347080
public function init ()
		{
			if (session_status() == PHP_SESSION_NONE)
				session_start();

			if (isset($_SESSION[ 'notification' ]))
			{
				$notification = $_SESSION[ 'notification' ];
				foreach ($notification as $type => $data)
					foreach ($data as $message)
						$this->_data[] = new Notification($message, $type, true);
				$_SESSION[ 'notification' ] = [];
			}
			parent::init();
		}
141695
public function setSessionId($sessionId)
    {
        $this->set(self::MAUTIC_SESSION_ID, $sessionId);
        $this->set(self::MTC_SID, $sessionId);

        return $this;
    }
907969
public function regenerateSessionId()
    {
        // starting session only if it was not started yet
        if (self::$_blIsNewSession) {
            $this->_sessionStart();

            // (re)setting actual user agent when initiating new session
            $this->setVariable("sessionagent", \OxidEsales\Eshop\Core\Registry::getUtilsServer()->getServerVar('HTTP_USER_AGENT'));
        }

        $this->_setSessionId($this->_getNewSessionId(false));
        $this->_initNewSessionChallenge();
    }
420187
public function start($start = null, $autoseek = true)
    {
        if (!func_num_args()) {
            return $this->_start;
        }
        $this->_start = (int) $start;

        if ($autoseek) {
            $this->rewind();
        }
        return $this;
    }
1116621
public void init() {
        if (incNestingCount() > 1) {
            return;
        }
        SessionFactory sf = getSessionFactory();
        if (sf == null) {
            return;
        }
        if (TransactionSynchronizationManager.hasResource(sf)) {
            // Do not modify the Session: just set the participate flag.
            setParticipate(true);
        }
        else {
            setParticipate(false);
            LOG.debug("Opening single Hibernate session in HibernatePersistenceContextInterceptor");
            Session session = getSession();
            HibernateRuntimeUtils.enableDynamicFilterEnablerIfPresent(sf, session);
            TransactionSynchronizationManager.bindResource(sf, new SessionHolder(session));
        }
    }
687436
public function transactionStart($transactionMode = false, $sessionCharacteristics = false)
    {
        if ($this->transactionNesting <= 0) {
            $this->transactionNesting = 1;
            $this->child->transactionStart($transactionMode, $sessionCharacteristics);
        } else {
            if ($this->child->supportsSavepoints()) {
                $this->child->transactionSavepoint("nesting" . $this->transactionNesting);
            }
            $this->transactionNesting++;
        }
    }
1008232
public function start()
	{
		if ($this->getState() === 'active')
		{
			return;
		}

		$this->_start();

		$this->setState('active');

		// Initialise the session
		$this->_setCounter();
		$this->_setTimers();

		// Perform security checks
		$this->_validate();

		if ($this->dispatcher instanceof DispatcherInterface)
		{
			$this->dispatcher->triggerEvent('onAfterSessionStart');
		}
	}
59988
public function getResponse($autoInit = null)
    {
        if (is_bool($autoInit)) {
            $this->setAutoInitResponse($autoInit);
        }
        if ($this->response == null && $this->isAutoInitResponse()) {
            $this->initResponse();
        }

        return $this->response;
    }
233339
public static function singleton ($sessionID = FALSE)
	{
		
		// If no instance is set
		
		if (self::$_instance === FALSE)
		{
			
			// Create an instance
			
			self::$_instance	= new static ($sessionID);
			
		}
		
		// Return instance
		
		return self::$_instance;
		
	}