Component/FilterComponent.php
public function getSession($key = null)
    {
        // merge the arrays, using the default values if not in the session
        $sessionData = (array) $this->session->get($this->sessionKey) + $this->sessionDefaults();

        if (null === $key) {
            return $sessionData;
        } else if (array_key_exists($key, $sessionData)) {
            return $sessionData[$key];
        } else {
            return null;
        }
    }
public function getSession($key = null)
    {
        // merge the arrays, using the default values if not in the session
        $sessionData = (array) $this->session->get($this->sessionKey) + $this->sessionDefaults();

        if (null === $key) {
            return $sessionData;
        } else if (array_key_exists($key, $sessionData)) {
            return $sessionData[$key];
        } else {
            return null;
        }
    }
Gets all or a single key from the session.

@param  string $key The session key to retrieve or null for the entire session.

@return mixed|null