有効なSuidSessionかどうか返します。

@return	bool	trueの場合は有効なsuid sessionがある、falseの場合はない
551391
public static function EnableSuidSession () {
		return !(Request::GetPostData()->__suid && !isset(Session::Read(static::_GetSeesionTransactionLayerPath())[Request::GetPostData()->__suid]));
	}
644064
public function loggedIn(): bool
    {
        $session = $this->getSession();
        if (! $session->isStarted()) {
            $session->start();
            // If there isn't a session started the user can't be logged in.
            return false;
        }

        $page = $session->getPage();

        // Look for a selector to determine if the user is logged in.
        try {
            // Search for the body element.
            $body_element = $page->find('css', 'body');

            // If the page doesn't have a body element the user is not logged in.
            if (null === $body_element) {
                return false;
            }

            // The user is logged in if:
            $is_logged_in = (
                // The body has a logged-in class (front-end).
                $body_element->hasClass('logged-in') ||
                // The body has a wp-admin class (dashboard)
                $body_element->hasClass('wp-admin')
            );
            return $is_logged_in;
        } catch (DriverException $e) {
            // This may fail if the user has not loaded any site yet.
        }

        return false;
    }
787210
public static function exists() : bool
    {
        // Start session if needed
        if (! session_id()) {
            Session::start();
        }

        // Loop all arguments
        foreach (func_get_args() as $argument) {

            // Array element
            if (is_array($argument)) {

                // Loop the keys
                foreach ($argument as $key) {

                    // Does NOT exist
                    if (! isset($_SESSION[(string) $key])) {
                        return false;
                    }
                }
            } else {

                // Does NOT exist
                if (! isset($_SESSION[(string) $argument])) {
                    return false;
                }
            }
        }

        return true;
    }
69130
protected function init(): bool
    {
        if (!isset($_SESSION[$this->name])) {
            $_SESSION[$this->name] = [];
        }
        return true;
    }
481676
protected function initialize()
    {
        if ($this->initialized) {
            // Already initialized
            return true;
        }

        if (session_status() !== PHP_SESSION_NONE) {

            if (isset($_SESSION[$this->key]) && is_array($_SESSION[$this->key])) {
                // Get the token collection from the session, if we got any
                $this->tokens = $_SESSION[$this->key];
            }

            $this->initialized = true;

        } else {

            throw new CsrfSessionException('A session must be started before the Csrf library can be used');

        }
    }
1273031
public static function sessionStart()
    {
        if (PHP_SAPI != 'cli') {
            return session_start();
        }

        self::tryGcSessions();

        if (HttpCache::$instance->sessionStarted) {
            echo "already sessionStarted\n";
            return true;
        }
        HttpCache::$instance->sessionStarted = true;
        // Generate a SID.
        if (!isset($_COOKIE[HttpCache::$sessionName]) || !is_file(HttpCache::$sessionPath . '/ses' . $_COOKIE[HttpCache::$sessionName])) {
            $file_name = tempnam(HttpCache::$sessionPath, 'ses');
            if (!$file_name) {
                return false;
            }
            HttpCache::$instance->sessionFile = $file_name;
            $session_id                       = substr(basename($file_name), strlen('ses'));
            return self::setcookie(
                HttpCache::$sessionName
                , $session_id
                , ini_get('session.cookie_lifetime')
                , ini_get('session.cookie_path')
                , ini_get('session.cookie_domain')
                , ini_get('session.cookie_secure')
                , ini_get('session.cookie_httponly')
            );
        }
        if (!HttpCache::$instance->sessionFile) {
            HttpCache::$instance->sessionFile = HttpCache::$sessionPath . '/ses' . $_COOKIE[HttpCache::$sessionName];
        }
        // Read session from session file.
        if (HttpCache::$instance->sessionFile) {
            $raw = file_get_contents(HttpCache::$instance->sessionFile);
            if ($raw) {
                $_SESSION = unserialize($raw);
            }
        }
        return true;
    }
651283
public function logout()
    {
        if (!$this->hasSudoed()) {
            return false;
        }

        $this->auth->logout();

        $originalUserId = $this->session->get($this->sessionKey);

        if ($originalUserId) {
            $this->auth->loginUsingId($originalUserId);
        }

        $this->session->forget($this->sessionKey);
        $this->session->forget('sudosu.has_sudoed');

        return true;
    }
68009
public function doLogout(): bool
    {
        // No user logged in
        if (empty($this->session['user'])) {
            return true;
        }

        // Store current user id for later use
        $user = $this->session['user'];

        // Remove autologin stuff?
        if ($this->remember) {
            $autologin = new Autologin($this->db);
            $autologin->setCookieName($this->cookie_name);
            $autologin->removeAutoLoginTokenAndCookie($user);
        }

        // Refresh session id and delete old session
        session_regenerate_id(true);

        // Clean up session
        unset($this->session['autologin_failed']);

        $this->session['user'] = 0;
        $this->session['logged_in'] = false;

        if (isset($this->logger)) {
            $this->logger->info('Logout: User [' . $user . ']');
        }

        return true;
    }
821462
public function startSession()
    {
        $swooleSession = SwooleSession::component();
        $swooleSession->gc(time());
        $swooleSession->write($this->getSessionId(), Lb::app()->serialize([]));
        return true;
    }
1171914
private function deleteOldSessions()
    {
        // 2% chance of kicking idle sessions
        if (mt_rand(0, 49)) {
            return false;
        }

        $sessions = new UsersSessionEntityRepository();
        $sessions->setOnlyOutdated();
        $sessions->deleteObjectCollection();

        return true;
    }
1033533
public function regenerateId(): bool
    {
        $result = \session_regenerate_id(true);
        if ($result && $this->csrfToken) {
            $this->csrfToken->regenerateValue();
        }

        return $result;
    }
763850
protected function getSessionId() {
    // check if we already have a session with the server
    $session = ObjectFactory::getInstance('session');
    $sids = $session->get(self::SIDS_SESSION_VARNAME);
    if (isset($sids[$this->serverCli])) {
      return $sids[$this->serverCli];
    }
    return null;
  }
1110476
public function store() {
        if (function_exists('igbinary_serialize')) {
            $s = @igbinary_serialize($this);
        } else {
            $s = @serialize($this);
        }
        if ($s) {
            $_SESSION[ self::SESSION_NAME . '_' . $this->type ] = $s;
        }

        return $s ? true : false;
    }
184721
protected function makeState()
    {
        if (!$this->request->hasSession()) {
            return false;
        }

        $state = sha1(uniqid(mt_rand(1, 1000000), true));
        $session = $this->request->getSession();

        if (is_callable([$session, 'put'])) {
            $session->put('state', $state);
        } elseif (is_callable([$session, 'set'])) {
            $session->set('state', $state);
        } else {
            return false;
        }

        return $state;
    }
1048925
protected function initialiseSession()
    {
        $session = $this->session ?: new Session();

        if ( ! $session->isStarted()) {
            $session->start();
        }

        return $this->session = $session;
    }
239582
public function getIsLogin(){
        if(isset($_SESSION[$this->storeKey])) return true;
        if(!empty($_COOKIE[$this->storeKey])){
            $data = $this->authCode($_COOKIE[$this->storeKey],'DECODE');
            $this->identity = json_decode($data,true);
            $this->saveLoginSession();
        }
        return false;
    }
1348474
protected function refreshSession()
    {
        //  Get the user; be wary of admin's logged in as other people
        $oSession = Factory::service('Session', 'nails/module-auth');
        if ($this->wasAdmin()) {

            $recoveryData = $this->getAdminRecoveryData();

            if (!empty($recoveryData->newUserId)) {
                $me = $recoveryData->newUserId;
            } else {
                $me = $oSession->getUserData('id');
            }

        } else {
            $me = $oSession->getUserData('id');
        }

        //  Is anybody home? Hello...?
        if (!$me) {
            $me = $this->me;
            if (!$me) {
                return false;
            }
        }

        $me = $this->getById($me);

        // --------------------------------------------------------------------------

        /**
         * If the user is isn't found (perhaps deleted) or has been suspended then
         * obviously don't proceed with the log in
         */

        if (!$me || !empty($me->is_suspended)) {
            $this->clearRememberCookie();
            $this->clearActiveUser();
            $this->clearLoginData();
            $this->bIsLoggedIn = false;
            return false;
        }

        // --------------------------------------------------------------------------

        //  Store this entire user in memory
        $this->setActiveUser($me);

        // --------------------------------------------------------------------------

        //  Set the user's logged in flag
        $this->bIsLoggedIn = true;

        // --------------------------------------------------------------------------

        //  Update user's `last_seen` and `last_ip` properties
        $oDb    = Factory::service('Database');
        $oInput = Factory::service('Input');

        $oDb->set('last_seen', 'NOW()', false);
        $oDb->set('last_ip', $oInput->ipAddress());
        $oDb->where('id', $me->id);
        $oDb->update($this->table);

        return true;
    }