Gets a session variable.

Example:

$token = RequestSession::get("token");
$username = RequestSession::get("username", ["default" => "root"]);

@param string $name    Session variable name
@param array  $options Options

@return mixed|null
359185
public static function get($name, $options = [])
    {
        RequestSession::_start();

        $default = isset($options["default"]) ? $options["default"] : null;

        return isset($_SESSION[$name]) ? $_SESSION[$name] : $default;
    }
367742
public static function get(string $name): ?string
    {
        $data = Session::get($name, null, self::$namespace);
        if (is_array($data) && array_key_exists('token', $data)) {
            return $data['token'];
        }
        return null;
    }
978170
public function bitGet($name, array $options)
  {
    $arr = array();

    foreach ($options as $b) {
      if ($this->bitCheck($name, $b)) {
        $arr[] = $b;
      }
    }

    return $arr;
  }
1226520
public function getSessionToken($options = array())
    {
        list($config, $acl, $durationSeconds) =
            $this->parseOptions(
                $options,
                'config',
                'acl',
                'durationSeconds'
            );
		
        $params = array();
        if ($durationSeconds !== null) {
            $params['durationSeconds'] = $durationSeconds;
        }
        $headers = array();
        if ($acl !== null) {
            $headers[HttpHeaders::CONTENT_LENGTH] = strlen($acl);
        } else {
            $headers[HttpHeaders::CONTENT_LENGTH] = 0;
        }
        $headers[HttpHeaders::CONTENT_TYPE] = HttpContentTypes::JSON;
        // prevent low version curl add a default pragma:no-cache
        $headers[HttpHeaders::PRAGMA] = '';
        $config['endpoint'] = $this->stsEndpoint;
        $config = array_merge(
            $this->config,
            $config
        );
        $path = HttpUtils::appendUri(StsClient::STS_URL_PREFIX, StsClient::GET_SESSION_TOKEN_VERSION, StsClient::GET_SESSION_TOKEN_PATH);

        $response = $this->httpClient->sendRequest(
            $config,
            HttpMethod::POST,
            $path,
            $acl,
            $headers,
            $params,
            $this->signer
        );
		
        return $this->parseJsonResult($response['body']);
    }
1133070
public function getSession($varname, $default = false)
    {
        if(isset($this->sessionvars[$varname])) {
            return $this->sessionvars[$varname];
        } else {
            return $default;
        }
    }
1235792
public function get($name, $options = null)
    {
        if ($this->has($name)) {
            return $this->resolve($name, $options);
        } else {
            $this->throwNotFound($name);
            return false;
        }
    }
317412
public static function getOptions($optionName = null)
    {
        $options = array();
        foreach (ini_get_all('session') as $sysOptionName => $sysOptionValues) {
            $options[substr($sysOptionName, 8)] = $sysOptionValues['local_value'];
        }
        foreach (self::$_localOptions as $localOptionName => $localOptionMemberName) {
            $options[$localOptionName] = self::${$localOptionMemberName};
        }

        if ($optionName) {
            if (array_key_exists($optionName, $options)) {
                return $options[$optionName];
            }
            return null;
        }

        return $options;
    }
717549
private function getOption(string $name)
    {
        return $this->input->hasOption($name) ? $this->input->getOption($name) : null;
    }
885245
public function get_var($name)
    {
        // Check if variable exists
        for ($i=0, $len=count($this->vars); $i<$len; $i++) {
            if ($this->vars[$i]['name'] == $name) {
                return $this->vars[$i]['name'];
            }
        }
    }
1141895
public function getVariable($name) {
		if (isset($this->variables[$name])) {
			return $this->variables[$name];
		} else {
			return null;
		}
	}
699374
public function getOption($name)
    {
        $method = 'get' . ucfirst($name);
        if (method_exists($this, $method) && $method !== __FUNCTION__) {
            return $this->$method();
        } elseif (isset($this->options[$name])) {
            return $this->options[$name];
        }
    }
729511
public static function getOption($name = null)
    {
        if (null === $name) {
            return self::$_options;
        } else {
            return isset(self::$_options[$name])? self::$_options[$name]: null;
        }
    }
366585
public function getVariable(string $name)
    {
        foreach ($this->variables as $variable) {
            if ($variable->getName() == $name) {
                return $variable;
            }
        }

        return null;
    }
982317
public function getSession($name)
    {
        if (!$this->hasSession($name)) {
            $this->createSession($name);
        }

        return $this->sessions[$name];
    }
1297561
public function get($name, $default = null)
    {
        $parsed = explode('.', $name);

        $result = $_SESSION;

        while ($parsed) {
            $next = array_shift($parsed);

            if (isset($result[$next])) {
                $result = $result[$next];
            } else {
                return $default;
            }
        }

        return $result;
    }
779056
public function option($name, $option = NULL, $fields = [])
	{
		return $name ? $this->get($name)->option($option, $fields) : NULL;
	}
602967
protected function getBlock($name, array &$options)
    {
        $block = [];

        /** @noinspection ReferenceMismatchInspection */
        if (array_key_exists($name, $options)) {
            $block = $options[$name];
            unset($options[$name]);
        }

        return $block;
    }