Get a session var value.

@param null $var

@return mixed
543815
public function sessionGet($var = null, $default = null)
    {
        if ($this->stateless) {
            return $default;
        }

        return $this->getRequest()->session()->get(
            $this->makeSessionVarName($var),
            $default
        );
    }
598807
protected function sessionForget($var = null)
    {
        if ($this->stateless) {
            return;
        }

        $this->getRequest()->session()->forget(
            $this->makeSessionVarName($var)
        );
    }
976887
public function extension($var = null)
    {
        if ($var !== null) {
            $this->extension = $var;
        }
        if (empty($this->extension)) {
            $this->extension = '.' . pathinfo($this->name(), PATHINFO_EXTENSION);
        }

        return $this->extension;
    }
593995
public static function key($key, $value = null)
  {
    if ($value == null) return $_SESSION[$key];

    $_SESSION[$key] = $value;
  }
1130922
function getVariable( $var, $fallbackValue = null )
    {
        $ret = $fallbackValue;
        if ( isset( $_GET[$var] ) )
        {
            $ret = $_GET[$var];
        }
        else if ( $ret === null )
        {
            eZDebug::writeWarning( "Undefined get variable: $var",
                                   "eZHTTPTool" );
        }
        return $ret;
    }
777323
protected function getSession()
    {
        if (null === $this->session) {
            if (null !== $this->getRequest()) {
                $this->session = $this->request->getSession();
            }
        }

        return $this->session;
    }
836452
public function getVariable($key)
    {
        if (!isset($this->variables[$key])) {
            return null;
        }
        return $this->variables[$key];
    }
98841
public function getVariable($key)
    {
        $key = (string) $key;
        return $this->hasVariable($key) ? $this->currentRequest->variables->$key : null;
    }
151657
public function get($name)
    {
        return ((isset($this->session[$name]) && null != $this->session[$name])? $this->session[$name] : null);
    }
471265
public function pageHeaderVarFunc($var, $pages = null)
    {
        if ($pages === null) {
            $pages = $this->grav['page'];
        }

        // Make sure pages are an array
        if (!\is_array($pages)) {
            $pages = [$pages];
        }

        // Loop over pages and look for header vars
        foreach ($pages as $page) {
            if (\is_string($page)) {
                $page = $this->grav['pages']->find($page);
            }

            if ($page) {
                $header = $page->header();
                if (isset($header->{$var})) {
                    return $header->{$var};
                }
            }
        }

        return null;
    }
1278768
public static function &get($key)
    {
        self::startIf();
        if (isset($_SESSION[$key])) {
            return $_SESSION[$key];
        } else {
            $val = null;
            return $val;
        }
    }
83047
public function getVariable(string $variable, $default = null)
    {
        if (isset($this->variables[$variable])) {
            return $this->variables[$variable];
        }

        return $default;
    }
1255700
public static function getAsString($var)
    {
        if ($var instanceof Exception) {
            return (string)$var;
        } elseif (is_object($var)) {
            return self::getObjectAsString($var);
        } elseif (is_array($var)) {
            return print_r($var, true);
        } elseif (is_resource($var)) {
            return (string)sprintf('resource(type=%s)', get_resource_type($var));
        } elseif (true === $var) {
            return 'true';
        } elseif (false === $var) {
            return 'false';
        } elseif (null === $var) {
            return 'null';
        }

        return (string)$var;
    }
525407
public function date($var = null)
    {
        if ($var !== null) {
            $this->date = Utils::date2timestamp($var, $this->dateformat);
        }

        if (!$this->date) {
            $this->date = $this->modified;
        }

        return $this->date;
    }
822976
public function post($var = null)
	{
		$this->id = 0;
		if (!empty($var)) {
			$routing = explode('/', $var);
			if (is_array($routing)) {
				$var = array_shift($routing);
				$this->id = empty($routing)
					? 0
					: array_shift($routing);
			} else {
				$var = $routing;
			}

			if ($this->checkAuth()) {
				// load action based off of naming conventions
				header('Content-Type: application/json');
				return $this->_autoaction($var, 'post');
			} else {
				return $this->getForbbiden($var);
			}
		} else {
			return $this->getNoop();
		}
	}
326066
public function get_variable($varname, $default = null)
    {
        if (!isset($this->variables)) {
            $this->variables = array();
        }

        if (array_key_exists($varname, $this->variables)) {
            return $this->variables[$varname];
        }

        // configured value has higher prio
        $conf_value = rcube::get_instance()->config->get('db_' . $varname);
        if ($conf_value !== null) {
            return $this->variables[$varname] = $conf_value;
        }

        $result = $this->query('SHOW VARIABLES LIKE ?', $varname);

        while ($row = $this->fetch_array($result)) {
            $this->variables[$row[0]] = $row[1];
        }

        // not found, use default
        if (!isset($this->variables[$varname])) {
            $this->variables[$varname] = $default;
        }

        return $this->variables[$varname];
    }
173276
public static function get($variable) {
		self::startSessionIfNeeded();
		// If it exists, and we do not want to overwrite, then throw exception
		if (! self::has($variable)) {
			throw new \Exception("{$variable} does not exist in the store.");
		}

		return unserialize($_SESSION[$variable]);
	}