Returns data

@param string|null $key The key from the session

@return scalar|null|array
970276
public function get($key = null)
    {
        //argument 1 must be a string or null
        Argument::i()->test(1, 'string', 'null');

        if (!self::$session) {
            Exception::i()->setMessage(self::ERROR_NOT_STARTED)->trigger();
        }

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

        if (isset($_SESSION[$key])) {
            return $_SESSION[$key];
        }

        return null;
    }
748924
public function returnOriginalData($key = null)
    {
        $this->_prepareData($key);

        $mergedData = array_merge($this->_DATA, $this->_originalDATA);
        $data       = $this->_removeNewKeys($mergedData);

        if (array_key_exists($key, $data)) {
            return $data[$key];
        }

        return null;
    }
1336777
public static function getData($key = null) {
        if (!isset($key)) {
            return self::$viewContext->viewData;
        }
        else {
            return isset(self::$viewContext->viewData[$key]) ? self::$viewContext->viewData[$key] : null;
        }
    }
617668
public function read($key) {
        return isset($_SESSION[$this->prefix . $key]) ? $_SESSION[$this->prefix . $key] : null;
    }
562905
public function get($key)
    {
        if (isset($_SESSION[$this->prefix . $key])) {
            return $_SESSION[$this->prefix . $key];
        }

        return null;
    }
514477
public static function  get($key)
	{
		//check if this key exists 
		$exists = (isset($_SESSION[$key])) ? true : false;

		//return check status if false
		if ( ! $exists)  return $exists;

		//return the session data if found
		else return $_SESSION[$key];

	}
147847
public function data($key = null) {
		$data = $this->body['data'];
		if ($key !== null) {
			foreach (explode('.', $key) as $part) {
				if (isset($data[$part])) {
					$data = $data[$part];
				} else {
					$data = null;
					break;
				}
			}
		}
		return $data;
	}
243573
public function getArray($key)
    {
        try {
            $result = $this->get(self::DATA_ARRAY, $key);
            if (!settype($result, 'array')) {
                return null;
            }
        } catch (\Exception $e) {
            return null;
        }
        return $result;
    }
912292
public function getDataset($key)
    {
        $data = $this->session->get(self::KEY);
        $set = isset($data[$key])
            ? $data[$key]
            : [];
        return $set;
    }
492486
public function getSessionItem($key)
    {
        return isset($this->session[$key]) ? $this->session[$key] : null;
    }
777770
private function fetchInfo($key)
    {
        return array_key_exists($key, $this->info)
            ? $this->info[$key]
            : null;
    }
1127057
public function get($key)
    {
        $file=$this->getCacheDir().$key;
        if(file_exists($file)){
            $content=file_get_contents($file);
            $content=unserialize($content);
            return $content;
        }
        return null;
    }
563088
public static function get($key)
    {
        if (isset($_SESSION[$key]) === false) {
            return null;
        }

        return unserialize($_SESSION[$key]);
    }
1257891
public function get($key) {

        if (!isset($this->hashmap[$key])) { return null; }

        $node = $this->hashmap[$key];
        if (count($this->hashmap) == 1) { return $node->getData(); }

        // refresh the access
        $this->detach($node);
        $this->attach($this->head, $node);

        return $node->getData();
    }
1214277
public static function get(string $key)
    {
        // Start session if needed
        if (! session_id()) {
            self::start();
        }

        // Fetch key
        if (Session::exists((string) $key)) {
            return $_SESSION[(string) $key];
        }

        // Key doesn't exist
        return null;
    }
501364
public function getMetadata($key = null)
    {
        if (!$key) {
            return $this['metadata'];
        }

        if (isset($this->definition['metadata'][$key])) {
            return $this->definition['metadata'][$key];
        }

        return null;
    }
1039255
protected function getData($key)
    {
        $cacheKey = $this->key($key);
        return array_key_exists($cacheKey, $this->cache)?$this->cache[$this->key($key)]:false;
    }