- foreach (glob($this->getPath() . "/sess_*") as $filename) {
 - if (filemtime($filename) + $maxlifetime < time()) {
 - unlink($filename);
 - }
 - }
 - return true;
 - }
 - /**
 - * A function that is called internally when session data is to be saved.
 - *
 - * @param string $sess_id The current session ID
 - * @param string $data The session data to write
 - *
 - * @return bool
 - */
 - protected function saveSession($sess_id, $data)
 - {
 - $sess_file = $this->getPath() . '/sess_' . $sess_id;
 - if ($fp = fopen($sess_file, "w")) {
 - $return = fwrite($fp, $data);
 - fclose($fp);
 - if ($return !== false) {
 - return true;
 - }
 - }
 - // If we got this far, something went wrong with the file output...
 - // It is tempting to throw an exception here, but this code is called
 - // outside of the context of exception handling, so all we can do is
 - // echo a message.
 - echo 'Cannot write session to ' . $sess_file . "\n";
 - return false;
 - }
 - }
 
        foreach (glob($this->getPath() . "/sess_*") as $filename) {
            if (filemtime($filename) + $maxlifetime < time()) {
                unlink($filename);
            }
        }
        return true;
    }
 
    /**
     * A function that is called internally when session data is to be saved.
     *
     * @param string $sess_id The current session ID
     * @param string $data    The session data to write
     *
     * @return bool
     */
    protected function saveSession($sess_id, $data)
    {
        $sess_file = $this->getPath() . '/sess_' . $sess_id;
        if ($fp = fopen($sess_file, "w")) {
            $return = fwrite($fp, $data);
            fclose($fp);
            if ($return !== false) {
                return true;
            }
        }
        // If we got this far, something went wrong with the file output...
        // It is tempting to throw an exception here, but this code is called
        // outside of the context of exception handling, so all we can do is
        // echo a message.
        echo 'Cannot write session to ' . $sess_file . "\n";
        return false;
    }
}
 
                  
                
                        // Anecdotal testing Today and Yesterday seems to indicate destroy()
        //   is called by the garbage collector and everything is good.
        // Something to keep in mind though.
        return true;
    }
 
    /**
     * Write function that is called when session data is to be saved.
     *
     * @param string $sess_id The current session ID
     * @param string $data    The session data to write
     *
     * @return bool
     */
    public function write($sess_id, $data)
    {
        if ($this->writesDisabled) {
            return true;
        }
        return $this->saveSession($sess_id, $data);
    }
 
    /**
     * A function that is called internally when session data is to be saved.
     *
     * @param string $sess_id The current session ID
     * @param string $data    The session data to write
     *
     * @return bool
     */
    abstract protected function saveSession($sess_id, $data);
}
 
                  
                
                     *
     * @return void
     */
    public function writeClose()
    {
        // The assumption is that we're using PHP's ext/session.
        // session_write_close() will actually overwrite $_SESSION with an
        // empty array on completion -- which leads to a mismatch between what
        // is in the storage object and $_SESSION. To get around this, we
        // temporarily reset $_SESSION to an array, and then re-link it to
        // the storage object.
        //
        // Additionally, while you _can_ write to $_SESSION following a
        // session_write_close() operation, no changes made to it will be
        // flushed to the session handler. As such, we now mark the storage
        // object isImmutable.
        $storage  = $this->getStorage();
        if (! $storage->isImmutable()) {
            $_SESSION = $storage->toArray(true);
            session_write_close();
            $storage->fromArray($_SESSION);
            $storage->markImmutable();
        }
    }
 
    /**
     * Attempt to set the session name
     *
     * If the session has already been started, or if the name provided fails
     * validation, an exception will be raised.
     *
     * @param  string $name
     * @return SessionManager
     * @throws Exception\InvalidArgumentException
     */
    public function setName($name)
    {
        if ($this->sessionExists()) {
            throw new Exception\InvalidArgumentException(
                'Cannot set session name after a session has already started'
                  
                
                | Key | Value | 
| edit | 10462125 | 
| Key | Value | 
| language | nl | 
| VUFIND_SESSION | sme690du6bquvo65oeato1qobt | 
| Key | Value | 
| __ZF | Array ( [_REQUEST_ACCESS_TIME] => 1762268192.5046 [_VALID] => Array ( [Zend\Session\Validator\Id] => sme690du6bquvo65oeato1qobt ) [FlashMessenger] => Array ( [EXPIRE_HOPS] => Array ( [hops] => 1 [ts] => 1762268192.5046 ) ) ) | 
| SessionState | Zend\Stdlib\ArrayObject Object ( [storage:protected] => Array ( [cookiePath] => / ) [flag:protected] => 2 [iteratorClass:protected] => ArrayIterator [protectedProperties:protected] => Array ( [0] => storage [1] => flag [2] => iteratorClass [3] => protectedProperties ) ) | 
| FlashMessenger | Zend\Stdlib\ArrayObject Object ( [storage:protected] => Array ( ) [flag:protected] => 2 [iteratorClass:protected] => ArrayIterator [protectedProperties:protected] => Array ( [0] => storage [1] => flag [2] => iteratorClass [3] => protectedProperties ) ) | 
| Key | Value | 
| REDIRECT_VUFIND_ENV | development | 
| REDIRECT_VUFIND_LOCAL_DIR | /usr/local/vufind/sites/eind | 
| REDIRECT_VUFIND_LOCAL_MODULES | Brocade | 
| REDIRECT_STATUS | 200 | 
| VUFIND_ENV | development | 
| VUFIND_LOCAL_DIR | /usr/local/vufind/sites/eind | 
| VUFIND_LOCAL_MODULES | Brocade | 
| HTTP_HOST | vufind2.brocade.uninova.nl | 
| HTTP_PRAGMA | no-cache | 
| HTTP_UPGRADE_INSECURE_REQUESTS | 1 | 
| HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) | 
| HTTP_ACCEPT | text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 | 
| HTTP_ACCEPT_ENCODING | gzip, deflate | 
| HTTP_COOKIE | language=nl; VUFIND_SESSION=sme690du6bquvo65oeato1qobt | 
| HTTP_VIA | 1.1 squid-proxy-5b5d847c96-ss9c4 (squid/6.13) | 
| HTTP_X_FORWARDED_FOR | 10.9.242.109 | 
| HTTP_CACHE_CONTROL | no-cache | 
| HTTP_CONNECTION | keep-alive | 
| PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin | 
| SERVER_SIGNATURE | <address>Apache/2.4.29 (Ubuntu) Server at vufind2.brocade.uninova.nl Port 80</address> | 
| SERVER_SOFTWARE | Apache/2.4.29 (Ubuntu) | 
| SERVER_NAME | vufind2.brocade.uninova.nl | 
| SERVER_ADDR | 10.251.0.151 | 
| SERVER_PORT | 80 | 
| REMOTE_ADDR | 216.73.216.13 | 
| DOCUMENT_ROOT | /var/www/html | 
| REQUEST_SCHEME | http | 
| CONTEXT_PREFIX | /eind | 
| CONTEXT_DOCUMENT_ROOT | /usr/local/vufind/public | 
| SERVER_ADMIN | webmaster@localhost | 
| SCRIPT_FILENAME | /usr/local/vufind/public/index.php | 
| REMOTE_PORT | 38280 | 
| REDIRECT_URL | /eind/Search/Advanced | 
| REDIRECT_QUERY_STRING | edit=10462125 | 
| GATEWAY_INTERFACE | CGI/1.1 | 
| SERVER_PROTOCOL | HTTP/1.1 | 
| REQUEST_METHOD | GET | 
| QUERY_STRING | edit=10462125 | 
| REQUEST_URI | /eind/Search/Advanced?edit=10462125 | 
| SCRIPT_NAME | /eind/index.php | 
| PHP_SELF | /eind/index.php | 
| REQUEST_TIME_FLOAT | 1762268192.484 | 
| REQUEST_TIME | 1762268192 |