Template function that get a flash session var
@param string $key
@return mixed
329638
public static function getFlash($key)
    {
        $var = Security::getInstance()->getFlash($key);
        Security::getInstance()->setFlash($key, null);
        return $var;
    }
1124628
public function flash($key, $value)
    {
        $_SESSION[$this->config['key']]['flash'][$key] = $value;
        $this->flash[$key] = $value;
    }
141271
public static function flash(string $key, $value = null)
  {
    /**
     * Check if session already has variables.
     *
     * If variables have already been set, merge the new
     * variables with the old ones.
     */
    return $_SESSION['application']['with'] = array_merge(
                                                isset($_SESSION['application']['with']) ? $_SESSION['application']['with'] : [],
                                                [$key => $value]
                                              );
  }
492486
public function getSessionItem($key)
    {
        return isset($this->session[$key]) ? $this->session[$key] : null;
    }
731755
public function getScriptURL($key)
    {
        return isset($this->scripts[$key]) ? $this->scripts[$key] : null;
    }
821646
public function get($key)
    {
        return isset($this->vars[$key]) ? $this->vars[$key] : false;
    }
422748
public static function get($key, $flash = false)
    {
        if (isset($_SESSION[$key]))
        {
            $session_value = $_SESSION[$key];
            if ($flash)
            {
                unset($_SESSION[$key]);
            }
            return $session_value;
        }

        return null;
    }
258131
public function getFlash($key, $alt = null)
    {
        $this->resumeSession();

        return $_SESSION[Session::FLASH_NOW][$this->name][$key] ?? $alt;
    }
1188149
public function getOnce($key, Closure $callback)
    {
        if ($this->has($key) !== false) {
            return $this->session[$key];
        } else {
            $value = $callback();
            $this->set($key, $value);
            return $value;
        }
    }
1357053
public function getFlash($key = null)
    {
        $messages = $flash = '';

        if (!Session::has('flashMessages')) {
            return false;
        }

        $flashArray = Session::get('flashMessages');

        // Check $key is valid flash type
        if (in_array($key, $this->validFlashTypes)) {
            if (isset($flashArray[$key])) {
                foreach ($flashArray[$key] as $msg) {
                    $messages .= '<p>'.$msg."</p>\n";
                }
            }

            $flash .= sprintf(
                $this->flashWrapper,
                strtolower(Inflector::getClassName($this->class)),
                $key,
                $messages
            );

            // clear the viewed messages from browser
            $this->clearViewedMessages($key);

            // Print ALL queued messages
        } elseif (is_null($key)) {
            foreach ($flashArray as $key => $msgArray) {
                $messages = '';
                foreach ($msgArray as $msg) {
                    $messages .= '<p>'.$msg."</p>\n";
                }

                $flash .= sprintf($this->flashWrapper, strtolower($this->class), $key, $messages);
            }

            // clear already viewed messages
            $this->clearViewedMessages();

            // Invalid message type
        } else {
            return false;
        }

        return $flash;
    }
1070913
public function offsetGet($key)
    {

        if(is_array($this->__var) && isset($this->__var[$key])){
	        return $this->recursive ? new self($this->__var[$key], true) : $this->__var[$key];
        }

        return false;
    }
1098069
protected function _getSessionKeyRedirect($key = null) {
		if (empty($key)) {
			$key = $this->_controller->request->here();
		}
		$cacheKey = md5((string)$key);

		return $cacheKey;
	}
1186427
public function get($key)
    {
        $fullKey = static::SESSION_NAME.'.'.$key;
        $base = Base::instance();
        $message = $base->get($fullKey);
        $base->clear($fullKey);

        return $message;
    }
57996
public function get(string $key)
    {
        $key = $this->getNamespacedKey($key);

        return $this->session->get($key);
    }
477793
public static function get($key)
    {
        empty(self::$prefix) && self::$prefix = Config::get('session_prefix');
        return (isset($_SESSION[self::$prefix . $key])) ? $_SESSION[self::$prefix . $key] : null;
    }
148531
public function getAlert($context, $key = null)
    {
        $session = $this->container->sessionHandler;

        // Get alert notices from page context, or failing that then session flash data
        $alert = (isset($context['alert'])) ? $context['alert'] : $session->getFlashData('alert');

        if ($key === null) {
            return $alert;
        }

        if (isset($alert[$key])) {
            if ($key === 'message' ) {
                return '<ul><li>' . implode('</li><li>', $alert['message']) . '</ul>';
            }

            return $alert[$key];
        }

        return null;
    }
793172
public static function getSessionValue($key, $default=null) {
		if(!isset($_SESSION)){
			session_start();
		}
		return (isset($_SESSION[$key]) ? $_SESSION[$key] : $default);
	}