Start a new session
@param string $sessionID Session ID
@return void
323707
public function Create ($sessionID = FALSE)
	{
		
		// If there is no session
		
		if (!session_id ())
		{
			
			// If there is a session ID
			
			if ($sessionID)
			{
				
				// Set it
				
				session_id ($sessionID);
				
			}
			
			// Start session
			
			session_start ();

		}

		
		// Send cache headers

		header ('Expires: Sun, 23 Nov 1984 03:13:37 GMT');
		header ('Last-Modified: ' . gmdate ('D, d M Y H:i:s') . ' GMT');
		header ('Cache-Control: no-store, no-cache, must-revalidate');
		header ('Cache-Control: post-check=0, pre-check=0', FALSE);
		header ('Pragma: no-cache');

		// Set session ID

		$this->_sessionID	= session_id ();
		
	}
377457
public function destroy($sessionId)
    {
        parent::destroy($sessionId);
        if (isset($_COOKIE[$this->cookieKeyName])) {
            setcookie($this->cookieKeyName, '', 1);
            unset($_COOKIE[$this->cookieKeyName]);
        }
        return true;
    }
641554
public function start() {

		if(!$this->started) {

			// only non-CLI environments are supposed to provide sessions

			if(PHP_SAPI !== 'cli') {
				
				// avoid starting an already started session

				if (
					(PHP_VERSION_ID >= 50400 && session_status() === PHP_SESSION_ACTIVE) ||
					(PHP_VERSION_ID < 50400 && session_id())
				) {
					throw new \RuntimeException('Failed to start the session: Session already started.');
				}

				// allow session only when no headers have been sent

				if (headers_sent($file, $line)) {
					throw new \RuntimeException(sprintf("Cannot start session. Headers have already been sent by file '%s' at line %d.", $file, $line));
				}

				if(!session_start()) {
					throw new \RuntimeException('Session start failed.');
				}
			}

			$this->loadSession();

		}
	}
650181
public function write($sessionID, $sessionData): bool
    {
        $dbData = ['session_id' => $sessionID, 'session_access_ts' => time(), 'session_data' => $sessionData];
        $query = $this->dbClass->prepare()->replaceInto($this->dbTable)->set($dbData);
        $result = $this->dbClass->execute($query) == 1 ? true : false;

        return $result;
    }
824709
private function _start()
	{
		if ($this->_state === self::STATE_RESTART) {
			session_id($this->_createId());
		}

		session_cache_limiter('none');

		return session_start();
	}
1238126
public function setSessionId($session_id=null)
    {
        $this->session_id= ($session_id!== null) ? $session_id : null;

        return $this;
    }
1282045
public function write(string $sessionId, string $sessionData)
    {
        $key = "{$this->sessionName}_{$sessionId}";

        return $this->redis->set($key, $sessionData, $this->getConfig()->get('session.maxLifeTime', 1440));
    }
1231985
public function start($session_id = null) {
        if ($this->session_id) {
            return $this->session_id;
        }
        $session_expire = $this->expire;
        $http_only      = true;
        @ini_set('session.use_cookies', 1);
        @session_set_cookie_params($session_expire, '/', '', false, $http_only);
        if ($session_expire) {
            @ini_set('session.gc_maxlifetime', $session_expire + 2);
        }
        $session_name = get_session_name();
        if (empty($session_id)) {
            $session_id = isset ($_COOKIE [ $session_name ]) ? $_COOKIE [ $session_name ] : null;
            if (empty ($session_id) && isset ($_REQUEST [ $session_name ])) {
                $session_id = $_REQUEST [ $session_name ];
            }
        }
        try {
            @session_name($session_name);
            if (!empty ($session_id)) {
                $this->session_id = $session_id;
                @session_id($session_id);
                @session_start();
            } else {
                @session_start();
                $this->session_id = session_id();
            }
        } catch (\Exception $e) {
            $msg = 'Cannot start session: ' . $e->getMessage();
            log_error($msg);

            return '';
        }

        return $this->session_id;
    }
140640
public function initSession($config)
    {
        $sessionConfig = new SessionConfig();
        $sessionConfig->setOptions($config);
        $sessionManager = new SessionManager($sessionConfig);
        $sessionManager->start();
        Container::setDefaultManager($sessionManager);
    }
1125254
public function setSessionID(string $session_id)
    {
        if (!defined('WEDETO_TEST') || WEDETO_TEST === 0)
            throw new \RuntimeException("Cannot change the session ID");

        $this->session_id = $session_id;
        return $this;
    }
1121174
public static function init() {

        if (self::$_sessionStarted == false) {

            self::start();
            self::$_sessionStarted = true;
        }

        // Thanks Jon - http://stackoverflow.com/questions/8311320/how-to-change-the-session-timeout-in-php
        $now = time();
        if (isset($_SESSION['expiration_time']) && $now > $_SESSION['expiration_time']) {

            self::destroy();
            self::start();
        }

        $timeout = 3600;
        if (!empty(Config::get('session', 'timeout'))) {

            $timeout = Config::get('session', 'timeout');
        }

        $_SESSION['expiration_time'] = $now + $timeout;
    }
706114
protected function doDestroy($sessionId): bool
    {
        $this->getFacade()->delete($this->prefix . $sessionId);

        return true;
    }
541720
public StartPullSessionResponse startPullSession(String sessionId) {
        StartPullSessionRequest request = new StartPullSessionRequest().withSessionId(sessionId);
        return startPullSession(request);
    }
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;
		}
	}
578968
private function _getSession($sessionId)
    {
        if (is_null($this->_session)) {
            $this->_session = $this->_repository->find(array('sessionId' => $sessionId));
        }

        return $this->_session;
    }
1192973
public function createPHPSession($sessionID = true)
    {
        if ($sessionID) {
            $_SESSION[$this->_sessionName] = $this->_session;
        }
        return $this;
    }
1051375
public function setId($id)
    {
        $context = $this->_context;

        if (!$context->started) {
            $this->_start();
        }

        $context->session_id = $id;
    }