- 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 |
save | 9348750 |
ui | theme2 |
Key | Value |
VUFIND_SESSION | b0qnlc71sn8s85i0d4v375p9g8 |
language | en |
Key | Value |
__ZF | Array ( [_REQUEST_ACCESS_TIME] => 1747310403.1514 [_VALID] => Array ( [Zend\Session\Validator\Id] => b0qnlc71sn8s85i0d4v375p9g8 ) [FlashMessenger] => Array ( [EXPIRE_HOPS] => Array ( [hops] => 1 [ts] => 1747310403.1514 ) ) [csrf] => Array ( [EXPIRE] => 1747310703 ) ) |
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 ) ) |
Followup | Zend\Stdlib\ArrayObject Object ( [storage:protected] => Array ( [url] => http://vufind2.brocade.uninova.nl/eind/MyResearch/SaveSearch?save=9348750&ui=theme2 ) [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 ) ) |
csrf | Zend\Stdlib\ArrayObject Object ( [storage:protected] => Array ( [tokenList] => Array ( [26189618673eb57daf557508f181f745] => e460c74e8a10ac326c2fda9e5c810326 ) [hash] => e460c74e8a10ac326c2fda9e5c810326-26189618673eb57daf557508f181f745 ) [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_CONNECTION | keep-alive |
HTTP_PRAGMA | no-cache |
HTTP_CACHE_CONTROL | 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 | VUFIND_SESSION=b0qnlc71sn8s85i0d4v375p9g8; language=en |
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 | 3.17.23.48 |
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 | 14406 |
REDIRECT_URL | /eind/MyResearch/SaveSearch |
REDIRECT_QUERY_STRING | save=9348750&ui=theme2 |
GATEWAY_INTERFACE | CGI/1.1 |
SERVER_PROTOCOL | HTTP/1.1 |
REQUEST_METHOD | GET |
QUERY_STRING | save=9348750&ui=theme2 |
REQUEST_URI | /eind/MyResearch/SaveSearch?save=9348750&ui=theme2 |
SCRIPT_NAME | /eind/index.php |
PHP_SELF | /eind/index.php |
REQUEST_TIME_FLOAT | 1747310403.11 |
REQUEST_TIME | 1747310403 |