Check if session-variable exists by page-filename.

@param string $name
@param string $page Default null which means current page PHP_SELF.
@return bool
191774
public static function pageHas(string $name, ?string $page = null): bool
    {
        if ($page === null) {
            $page = $_SERVER['PHP_SELF'];
        }
        return self::has($name, $page);
    }
714177
public function __isset(string $name): bool
    {
        try {
            $value = $this->__get($name);

            $result = ($value !== null);
        } catch (Exception $e) {
            $result = false;
        }

        return $result;
    }
42811
public function deletePage(Page $page)
    {
        $findPage = $this->findPage($page);
        if ($findPage === false) {
            return false;
        }

        $deleteStm = $this->connection->prepare("DELETE FROM Page WHERE page_id=?");
        $deleteStm->execute([$page->getID()]);
        if (!$deleteStm->rowCount() > 0) {
            return false;
        }
        if ($findPage == 'active') {
            unset($this->activePages[$page->getID()]);
        } else {
            unset($this->inactivePages[$page->getID()]);
        }

        return true;
    }
1352906
public function session($name = null, $default = null) {
        if (null === $name) {
            return $_SESSION;
        }
        if (isset($_SESSION[$name])) {
            return $_SESSION[$name];
        }
        return $default;
    }
155455
public function exists($name): bool
    {
        $filename = $this->getFilename($name);
        if ($filename === false) {
            return false;
        }

        return true;
    }
1185546
protected function getPageContainerHtmlByName(
        PhpRenderer $view,
        Page $page,
        $name
    ) {
        $revision = $page->getCurrentRevision();

        if (empty($revision)) {
            throw new PageNotFoundException('No revision found for this page.');
        }

        $pluginWrapperRows = $revision->getPluginWrappersByPageContainerName(
            $name
        );

        $pluginHtml = '';

        if (!empty($pluginWrapperRows) && is_array($pluginWrapperRows)) {
            $pluginHtml = $this->getPluginRowsHtml(
                $view,
                $pluginWrapperRows
            );
        }

        return $this->getContainerWrapperHtml(
            $revision->getRevisionId(),
            $name,
            $pluginHtml,
            true
        );
    }
387451
public static function ExistsClassSession ($name = null, $class_path = null) {
		return Session::Exists(static::_GetSeesionClassLayerPath($name, $class_path ?: static::class));
	}
1302255
public function fileExists(string $name)
    {
        if(!$this->_isLoaded) {
            $this->load();
        }

        return in_array($name, $this->_files);
    }
846463
public function setPage($page = null)
    {
        // The following argument formats are supported:
        //
        // null = set current page
        // '.' = set current page
        // 'page' = sets webroot/page.html
        // './page' = set page relatively to current page
        // '..' = parent page
        // '../page' = page besides our own (foo/bar -> foo/page)
        // 'index' = properly points to the index page defined in APP
        // '/admin/' = will not be converted

        /** @type $this->app App_Web */

        $destination = '';

        if (is_null($page)) {
            $page = '.';
        }

        foreach (explode('/', $page) as $component) {
            if ($component == '') {
                continue;
            }
            if ($component == '.' && $destination == '') {
                if ($this->app->page == 'index') {
                    continue;
                }
                $destination = str_replace('_', '/', $this->app->page);
                continue;
            }

            if ($component == '..') {
                if (!$destination) {
                    $destination = str_replace('_', '/', $this->app->page);
                }
                $tmp = explode('/', $destination);
                array_pop($tmp);
                $destination = implode('/', $tmp);
                continue;
            }

            if ($component == 'index' && $destination == '') {
                $destination = $this->app->index_page;
                continue;
            }

            $destination = $destination ? $destination.'/'.$component : $component;
        }
        if ($destination === '') {
            $destination = @$this->app->index_page;
        }

        $this->page = $destination;

        // check if it's current page
        list($p, $ap) = str_replace('/', '_', array($this->page, $this->app->page));
        $this->_current = ($p == $ap); // page exactly match
        $this->_current_sub = ($p == substr($ap, 0, strlen($p)) && isset($ap[strlen($p)]) && $ap[strlen($p)] == '_'); // first part of page match followed by separator

        return $this;
    }
1105450
protected function shouldShowInNavigation(&$page)
    {
        if (isset($page['rcmOnly'])
            && $page['rcmOnly']
            && empty($this->page)
        ) {
            return false;
        }

        if (isset($page['acl']) && is_array($page['acl'])
            && !empty($page['acl']['resource'])
        ) {
            $privilege = null;
            if (!empty($page['acl']['privilege'])) {
                $privilege = $page['acl']['privilege'];
            }

            $resource = $page['acl']['resource'];

            $resource = str_replace(
                [
                    ':siteId',
                    ':pageName'
                ],
                [
                    $this->currentSite->getSiteId(),
                    $this->page->getName()
                ],
                $resource
            );

            if (!empty($this->page)) {
                $resource = str_replace(
                    [
                        ':siteId',
                        ':pageName'
                    ],
                    [
                        $this->currentSite->getSiteId(),
                        $this->page->getName()
                    ],
                    $resource
                );
            } else {
                $resource = str_replace(
                    [':siteId'],
                    [$this->currentSite->getSiteId()],
                    $resource
                );
            }

            if (!$this->isAllowed->__invoke(
                GetPsrRequest::invoke(),
                $resource,
                $privilege
            )
            ) {
                return false;
            }
        }

        return true;
    }
742628
public static function startPage($page = null)
    {
        if ($page !== null) {
            self::$_startPage = $page;
        }
        return self::$_startPage;
    }
1326934
public function has($name)
    {
        $key = mb_strtolower($name);
        foreach ($this->cookies as $cookie) {
            if (mb_strtolower($cookie->getName()) === $key) {
                return true;
            }
        }

        return false;
    }
681054
public function __isset($name)
    {
        if ($name != 'session') {
            throw new InvalidArgumentException;
        }

        if (isset($this->globals['_SESSION'])) {
            $this->session = &$this->globals['_SESSION'];
        }

        return isset($this->session);
    }
707868
public function cookieExists($name)
    {
        $message = sprintf('Cookie "%s" is not set, but should be.', $name);
        $this->assert($this->session->getCookie($name) !== null, $message);
    }
678052
public function existsController($name, $action = null)
    {
        $names = explode('_', $name);
        array_unshift($names, 'Controller');
        $base = join(DS, array_map('ucfirst', $names)) . 'Controller.php';

        $file = $this->loader->findFirst($base);
        if ($file) {
            $class = $file->getClassName();
            if (! $action && class_exists($class)) return true;
            
            $action = $this->actionNameStrategy($action);
            if (method_exists($class, $action)) return true;
        }

        return false;
    }
308653
public static function exists($name)
    {
        if (isset($_COOKIE[$name]) && !empty($_COOKIE[$name])) {
            return true;
        } else {
            return false;
        }
    }
863339
public function has($name):bool
    {
        return ((isset($this->session[$name]) && null != $this->session[$name])? true : false);
    }