セッションデータを空にする

@return  $this

@throws  Exception\SessionException
427375
public function clear(){
        if($this->status() !== self::ACTIVE){
            throw Exception\SessionException::notStarted();
        }

        session_unset();

        return $this;
    }
846344
public function refresh()
    {
        //Create the namespace if it doesn't exist
        $namespace = $this->getNamespace();

        if(!isset($_SESSION[$namespace])) {
            $_SESSION[$namespace] = array();
        }

        //Re-load the session containers
        foreach($this->_containers as $container)
        {
            $namespace = $this->getNamespace();
            $container->load($_SESSION[$namespace]);
        }

        return $this;
    }
1273488
public function reset()
    {
        $this->_set_query = null;
        $this->_loaded = false;
        $this->_object_set = new ArrayObject();

        return $this;
    }
56297
public function getSessionBag()
    {
        if (null === $this->sessionBag) {
            if (!$this->container) {
                throw new Exception('A container object is required to access the \'session_bag\' service.');
            }

            $this->sessionBag = $this->container->get('session_bag', [$this->bagName]);
        }

        return $this->sessionBag;
    }
683999
public function refresh()
    {
        $url = self::classUrl() . "?id=" . $this->instanceId();
        list($resp, $usedOpts) = self::request(self::METHOD_GET, $url);
        $body = isset($resp['data'][0]) ? $resp['data'][0] : null;
        $this->install($body, $usedOpts);
        return $this;
    }
49743
private function sessionExpiry()
    {
        $dateTime = new DateTime();
        if (null !== $this->sessionOptions['SessionExpiry']) {
            $expiryDateTime = new DateTime($_SESSION['Expiry']);
            $expiryDateTime->add(new DateInterval($this->sessionOptions['SessionExpiry']));
            if ($expiryDateTime < $dateTime) {
                $this->destroy();
            }
        }
    }
1178448
public function start()
    {
        if (!$this->isStarted()) {
            if ($this->cookie
                && !empty($_COOKIE[session_name()])
            ) {
                session_id($_COOKIE[session_name()]);
            }

            session_start();
        }

        return $this;
    }
656064
protected function prepare()
    {
        $this
            ->getSession()
            ->getConnection()
            ->sendPrepareQuery(
                $this->getClientIdentifier(),
                $this->orderParameters($this->sql)
            );
        $this->is_prepared = true;

        return $this;
    }
705766
private function startSession() {

        if (session_id() == "" || session_id() == null) {
            if (isset ($_REQUEST ["HTTPSESSID"])) {
                session_id($_REQUEST ["HTTPSESSID"]);
            }
            else if (isset ($_REQUEST ["PHPSESSID"])) {
                session_id($_REQUEST ["PHPSESSID"]);
            }
        }

        $cookieDomain = Configuration::instance()->getParameter('session.cookie.domain');
        if ($cookieDomain) {

            if ($cookieDomain == "WILDCARD") {
                $host = isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "";
                if ($host) {
                    $splitHost = explode(".", $host);
                    $tld = array_pop($splitHost);
                    $domain = array_pop($splitHost);
                    $cookieDomain = ".$domain.$tld";
                } else {
                    return;
                }
            }



            ini_set("session.cookie_domain", $cookieDomain);
        }

        @session_start();

    }
438643
public function touch()
    {
        if ($this->started !== true) {
            throw new Exception\SessionNotStartedException('Tried to touch a session, but the session has not been started yet.', 1354284318);
        }

        // Only makes sense for remote sessions because the currently active session
        // will be updated on shutdown anyway:
        if ($this->remote === true) {
            $this->lastActivityTimestamp = $this->now;
            $this->writeSessionMetaDataCacheEntry();
        }
    }
612985
final public function create()
    {

        $self = $this;

        $splash = $self->getSplash();
        $sessId = $this->generateId($splash);

        session_id($sessId); //Must be called before the sesion start to generate the Id
        session_cache_limiter('none');

        session_name(md5($self->cookie . $splash['agent'] . $splash['ip'] . $splash['domain']));
        session_start();

        //Create the default namespace; affix to splash;
        //The default namespace will contain vars such as -request count, - last session start time, -last session response time, etc
        //The dfault namespace will also contain, instantiated objects?
        //
        $defaultReg = new Registry("default");
        $self->registry['default'] = $defaultReg;

        //update the cookie with the expiry time
        //Create the authenticated namespace and lock it!
        $self->set("handler", $this->authenticator, "auth");

        $this->write($sessId, $splash);
    }
100355
public static function initialize()
    {
        if (!isset($GLOBALS['_SESSION']) or !($GLOBALS['_SESSION'] instanceof self)) {
            $GLOBALS['_SESSION'] = self::getInstance();
        }

        return self::getInstance();
    }
1277438
public function clear(): SessionInterface
    {
        $values = $this->getAll();

        if (count($values) > 0) {
            $this->delete(...array_keys($values));
        }

        return $this;
    }
619826
public function start()
    {
        if (headers_sent() || $this->id) {
            return false;
        }

        if ($this->data !== null) {
            throw new Exception('The property "data" cannot be set until the session is started.');
        }
        $this->data = array();

        if ($this->requestedId) {
            $this->setCookie($this->name, $this->requestedId);
            $this->id = $this->requestedId;
        } else {
            $id = $this->getIdFromCookie();
            $this->id = $id ? $id : IdGenerator::generateSessionId($this->idLength);
        }

        // open storage (reqd for GC)
        $this->handler->open($this->savePath, $this->name);

        // should we call GC?
        $rand = mt_rand(1, $this->gc_divisor);
        if ($rand <= $this->gc_probability) {
            $this->handler->gc($this->gc_maxlifetime);
        }

        if (!$this->requestedId) {
            // try data fetch
            if (!$this->loadData()) {
                // unlike the native PHP session, we don't let users choose their own
                // session IDs if there's no data. This prevents session fixation through
                // cookies (very hard for an attacker, but why leave this door open?).
                $this->id = IdGenerator::generateSessionId($this->idLength);
                $this->setCookie($this->name, $this->id);
            }
        }
        $this->requestedId = null;

        $this->sendStartHeaders();

        return true;
    }
478901
public function createSessionContainer()
    {
        // Check and start a default session if a custom session container is not supplied
        if(!isset($this->config['container'])) {
            session_start();
            return;
        }
        // Create an instance of the session container. Session containers are responsible for starting the session.
        $sessionContainerType = $this->config['container'];
        $className = '\ntentan\sessions\containers\\' . Text::ucamelize($sessionContainerType) . 'SessionContainer';
        $sessionContainer = new $className($this->config);
        return $sessionContainer;
    }
1048925
protected function initialiseSession()
    {
        $session = $this->session ?: new Session();

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

        return $this->session = $session;
    }
712181
public static function init()
    {
        self::add(self::HEADER_SET_COOKIE, '__Host-sess=' . session_id() . '; path=' . Request::$subfolders . '; Secure; HttpOnly; SameSite;');
        if (Request::isSecure()) {
            self::add(self::HEADER_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_SECURE);
            self::add(self::HEADER_STRICT_TRANSPORT_SECURITY, self::HEADER_STRICT_TRANSPORT_SECURITY_CONTENT);
            self::add(self::HEADER_X_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_SECURE);
        } elseif (Request::isLocalhost()) {
            self::add(self::HEADER_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_LOCALHOST);
            self::add(self::HEADER_X_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_LOCALHOST);
        } else {
            self::add(self::HEADER_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_INSECURE);
            self::add(self::HEADER_X_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_INSECURE);
        }
        self::$initialized = true;
    }