Get a single session by index from the session array.
@param mixed $key.
492486
public function getSessionItem($key)
    {
        return isset($this->session[$key]) ? $this->session[$key] : null;
    }
31545
public function get($key){
		$mc=$this->getMemcache();
		if(empty($mc))return NULL;
		$this->queries_get_count++;
		return $mc->get($key);
		}
649926
public function session($key = '', $value = '')
    {
        $this->sessionStart();

        if (is_null($key)) {
            if (empty($_SESSION)) {
                return null;
            }

            unset($_SESSION);
        } elseif ('' === $key) {
            // Get All Session
            return $_SESSION;
        }

        if ('' === $value) {
            return isset($_SESSION[$key]) ? $_SESSION[$key] : null;
        } else {
            if (is_null($value)) {
                unset($_SESSION[$key]);
            } else {
                $_SESSION[$key] = $value;
            }
        }

        return null;
    }
892247
public function removeSessionItem($key)
    {
        if (isset($this->session[$key])) {
            unset($this->session[$key]);
            return true;
        } else {
            return false;
        }
    }
792474
protected function hasState($key) {
		$session = Yii::app()->session;
		$key = $this->getStateKeyPrefix() . $key;
		return isset($session[$key]);
	}
334379
public static function getAndRemove(string $key)
    {
        static::startSessionIfNotHasStartedForceWrite();

        $value = static::get($key);
        static::remove($key);

        return $value;
    }
789007
function read($key)
    {
        if (array_key_exists($key, $this->cache)) {
            return $this->cache[$key];
        }

        return $this->read_record($key, true);
    }
361177
private function sessionBinding($key)
    {
        if (null !== $this->sessionOptions[$key]) {
            if (!\array_key_exists($key, $_SESSION)) {
                $_SESSION[$key] = $this->sessionOptions[$key];
            }
            if ($this->sessionOptions[$key] !== $_SESSION[$key]) {
                throw new SessionException(\sprintf('session bound to %s, we got "%s", but expected "%s"', $key, $_SESSION[$key], $this->sessionOptions[$key]));
            }
        }
    }
788658
public function get($key)
    {
        $value = $this->memcached->get($key);

        return is_array($value) ? $value[0] : $value;
    }
566149
static function get_value( $key ) {
		if( ! self::started() ){
			trigger_error("Session not started, cannot get_value", E_USER_WARNING );
			return null;
		}
		if( !is_array($key) ){
			$key = explode( '.', $key );
		}
		$Obj = self::$Session->Data;
		foreach( $key as $k ){
			if( !isset( $Obj[$k] ) ){
				return null;
			}
			$Obj = $Obj[$k];
		}
		return $Obj;
	}
1331401
public static function session($key = false) {

        if (isset($_SESSION)) {

            if ($key) {

                return $_SESSION[$key];
            }

            return $_SESSION;
        }

        return false;
    }
1037428
public function getValue($key, $lockSession = false) {
        $allValues = $this->getAllValues($lockSession);
        if (isset($allValues[$key])) {
            return $allValues[$key];
        } else {
            return null;
        }
    }
966520
public function getData($key)
    {
        if ($this->started !== true) {
            throw new Exception\SessionNotStartedException('Tried to get session data, but the session has not been started yet.', 1351162255);
        }
        return $this->storageCache->get($this->storageIdentifier . md5($key));
    }
617668
public function read($key) {
        return isset($_SESSION[$this->prefix . $key]) ? $_SESSION[$this->prefix . $key] : null;
    }
152907
public function remove($key): void
    {
        foreach ((array) $key as $key) {
            unset($_SESSION[$this->name][$key]);
        }
    }
1086027
public function get($key)
    {
        $this->load();
        $value = NestedArrayUtil::getNestedArrayValue($this->state, explode('.', $key), $exists);

        return $exists ? $value : false;
    }
57996
public function get(string $key)
    {
        $key = $this->getNamespacedKey($key);

        return $this->session->get($key);
    }