Sets the current session.

@param BindingSessionInterface $session
346095
protected function setSession(BindingSessionInterface $session)
    {
        $this->session = $session;
        $succinct = $session->get(SessionParameter::BROWSER_SUCCINCT);
        $this->succinct = $succinct ?? true;

        $this->dateTimeFormat = DateTimeFormat::cast($session->get(SessionParameter::BROWSER_DATETIME_FORMAT));
    }
104802
public function assertSession($session = null)
    {
        if (!($session instanceof Session)) {
            $session = $this->getSession($session);
        }

        return new WebAssert($session);
    }
488216
public function set(string $key, $value){
        if($this->status() !== self::ACTIVE){
            throw Exception\SessionException::notStarted();
        }

        $_SESSION[$key] = $value;
    }
356956
public void removeHttpSession(HttpSession session) {
		if (session == activeSession) {
			activeSession = null;
		}
		synchronized (this.sessions) {
			this.sessions.remove(session);
		}
		this.model.removeHttpSession(session);
		session.invalidate();
	}
1224273
private static function session($session)
    {
        $files = ['Session'];
        $folder = static::$root.'Storage'.'/';

        self::call($files, $folder);

        $files = ['SessionKeyNotFoundException', 'SessionSurfaceIsOffException'];
        $folder = static::$root.'Storage/Exceptions'.'/';

        self::call($files, $folder);

        //Initiat the class
        if ($session) {
            Session::ini();
        }
    }
924323
public function set($name, $value) : void
    {
        $_SESSION[$name] = $value;

        parent::set($name, $value);
    }
514806
protected function saveFilters(SessionInterface $session, array $filters)
    {
        $this->saveValues($filters, $this->getFilterPrefix(), $session);
    }
122116
protected function setSessionConfiguration()
    {
        if (! $this->supportsSessions
            || $this->config->get('session.driver') !== 'redis-sentinel'
            || $this->config->get('session.connection') !== null
        ) {
            return;
        }

        $this->setConfigurationFor('session.connection', false);
    }
275692
public function setSession($session = null, $write_cookie = true) {
        if ($this->debug) { $start = microtime(true); }
        $session = $this->validateSessionObject($session);
        $this->sessionLoaded = true;
        $this->session = $session;
        if ($write_cookie) {
            $this->setCookieFromSession($session);
        }
        if ($this->debug) { $this->timer[__FUNCTION__]['elapsed'][] = microtime(true)-$start; }
        return $this;
    }
839048
public function setCurrentPage($page)
    {
        $this->current_page = max(1, (int) $page);

        $this->current_record = ($this->current_page - 1) * $this->page_size;
    }
472491
private function storeUserSession($session)
    {
        // get all sessions
        $sessions = $this->getMeta()->sessions->val();
        if (!is_array($sessions)) {
            $sessions = [];
        }

        // delete the old sessions
        $newSessions = [];
        $ttl = $this->getSessionTtl();
        foreach ($sessions as $s) {
            if (($s['created'] + $ttl) > time()) {
                $newSessions[] = $s;
            }
        }

        // append the new session
        $newSessions[] = ['sid' => $session, 'created' => time(), 'ip' => $this->ip];

        // update the last login date
        $this->getMeta()->lastLogin = time();

        // append a new login attempt
        $this->getMeta()->loginAttempts[] = ['ip' => $this->ip, 'timestamp' => time()];

        // update the entity
        $this->getMeta()->sessions = $newSessions;
        $this->getMeta()->save();
    }
1325145
public function up(SessionInterface $session)
    {
        $this->session = $session;
        $this->iterateStructures(true);
        $this->upgradeExternalLinks(true);
    }
1049512
public function setSessionIndex(string $sessionIndex = null) : void
    {
        if (is_null($sessionIndex)) {
            $this->sessionIndexes = [];
        } else {
            $this->sessionIndexes = [$sessionIndex];
        }
    }
719572
private function setSessionData(int $time): void
    {
        $this->id = \session_id();
        $this->data['time'] = $time;
        $this->data['expire'] = $this->expire;
        $this->status = \session_status();
    }
1339889
public void setSessionState(JingleSessionState stateIs) {

        LOGGER.fine("Session state change: " + sessionState + "->" + stateIs);
        stateIs.enter();
        sessionState = stateIs;
    }
637744
public void deleteSession(String session) {
    for (Set<String> sessions : hostsToSessions.values()) {
      sessions.remove(session);
    }
  }
496006
public function release(Session $session)
    {
        $this->config['lock']->synchronize(function () use ($session) {
            $item = $this->cacheItemPool->getItem($this->cacheKey);
            $data = $item->get();
            $name = $session->name();

            if (isset($data['inUse'][$name])) {
                unset($data['inUse'][$name]);
                array_push($data['queue'], [
                    'name' => $name,
                    'expiration' => $session->expiration()
                        ?: $this->time() + SessionPoolInterface::SESSION_EXPIRATION_SECONDS
                ]);
                $this->cacheItemPool->save($item->set($data));
            }
        });
    }