- 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 |
lng | sv |
redirect | 0 |
Key | Value |
__ZF | Array ( [_REQUEST_ACCESS_TIME] => 1744204383.8037 [_VALID] => Array ( [Zend\Session\Validator\Id] => 1lhc67k9te776g0ob2k1m59ctq ) [FlashMessenger] => Array ( [EXPIRE_HOPS] => Array ( [hops] => 1 [ts] => 1744204383.8037 ) ) ) |
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_SCRIPT_URL | /vufind/MyResearch/Home |
REDIRECT_SCRIPT_URI | https://vufind.reshare-dev.indexdata.com/vufind/MyResearch/Home |
REDIRECT_VUFIND_ENV | development |
REDIRECT_VUFIND_LOCAL_DIR | /usr/local/vufind/local |
REDIRECT_VUFIND_LOCAL_MODULES | ReShare |
REDIRECT_Shib-Handler | https://vufind.reshare-dev.indexdata.com/Shibboleth.sso |
REDIRECT_HTTPS | on |
REDIRECT_SSL_TLS_SNI | vufind.reshare-dev.indexdata.com |
REDIRECT_STATUS | 200 |
SCRIPT_URL | /vufind/MyResearch/Home |
SCRIPT_URI | https://vufind.reshare-dev.indexdata.com/vufind/MyResearch/Home |
VUFIND_ENV | development |
VUFIND_LOCAL_DIR | /usr/local/vufind/local |
VUFIND_LOCAL_MODULES | ReShare |
Shib-Handler | https://vufind.reshare-dev.indexdata.com/Shibboleth.sso |
HTTPS | on |
SSL_TLS_SNI | vufind.reshare-dev.indexdata.com |
SSL_SERVER_S_DN_CN | vufind.reshare-dev.indexdata.com |
SSL_SERVER_I_DN_C | US |
SSL_SERVER_I_DN_O | Let's Encrypt |
SSL_SERVER_I_DN_CN | R10 |
SSL_SERVER_SAN_DNS_0 | vufind.reshare-dev.indexdata.com |
SSL_VERSION_INTERFACE | mod_ssl/2.4.29 |
SSL_VERSION_LIBRARY | OpenSSL/1.1.1 |
SSL_PROTOCOL | TLSv1.3 |
SSL_SECURE_RENEG | false |
SSL_COMPRESS_METHOD | NULL |
SSL_CIPHER | TLS_AES_128_GCM_SHA256 |
SSL_CIPHER_EXPORT | false |
SSL_CIPHER_USEKEYSIZE | 128 |
SSL_CIPHER_ALGKEYSIZE | 128 |
SSL_CLIENT_VERIFY | NONE |
SSL_SERVER_M_VERSION | 3 |
SSL_SERVER_M_SERIAL | 04F8AE553B0E5CEF60E98673670608735663 |
SSL_SERVER_V_START | Feb 22 15:38:37 2025 GMT |
SSL_SERVER_V_END | May 23 15:38:36 2025 GMT |
SSL_SERVER_S_DN | CN=vufind.reshare-dev.indexdata.com |
SSL_SERVER_I_DN | CN=R10,O=Let's Encrypt,C=US |
SSL_SERVER_A_KEY | rsaEncryption |
SSL_SERVER_A_SIG | sha256WithRSAEncryption |
SSL_SESSION_ID | 40dbfc97b4540efe12eeb7989a1576ab6e00248b4c2137b095ab75d808d45d0d |
SSL_SESSION_RESUMED | Initial |
HTTP_HOST | vufind.reshare-dev.indexdata.com |
HTTP_CONNECTION | keep-alive |
HTTP_PRAGMA | no-cache |
HTTP_CACHE_CONTROL | no-cache |
HTTP_SEC_CH_UA | "HeadlessChrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129" |
HTTP_SEC_CH_UA_MOBILE | ?0 |
HTTP_SEC_CH_UA_PLATFORM | "Windows" |
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_SEC_FETCH_SITE | none |
HTTP_SEC_FETCH_MODE | navigate |
HTTP_SEC_FETCH_USER | ?1 |
HTTP_SEC_FETCH_DEST | document |
HTTP_ACCEPT_ENCODING | gzip, deflate, br, zstd |
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 vufind.reshare-dev.indexdata.com Port 443</address> |
SERVER_SOFTWARE | Apache/2.4.29 (Ubuntu) |
SERVER_NAME | vufind.reshare-dev.indexdata.com |
SERVER_ADDR | 172.31.44.139 |
SERVER_PORT | 443 |
REMOTE_ADDR | 18.191.255.240 |
DOCUMENT_ROOT | /var/www/html |
REQUEST_SCHEME | https |
CONTEXT_PREFIX | /vufind |
CONTEXT_DOCUMENT_ROOT | /usr/local/vufind/public |
SERVER_ADMIN | webmaster@localhost |
SCRIPT_FILENAME | /usr/local/vufind/public/index.php |
REMOTE_PORT | 18211 |
REMOTE_USER | |
REDIRECT_URL | /vufind/MyResearch/Home |
REDIRECT_QUERY_STRING | lng=sv&redirect=0 |
GATEWAY_INTERFACE | CGI/1.1 |
SERVER_PROTOCOL | HTTP/1.1 |
REQUEST_METHOD | GET |
QUERY_STRING | lng=sv&redirect=0 |
REQUEST_URI | /vufind/MyResearch/Home?lng=sv&redirect=0 |
SCRIPT_NAME | /vufind/index.php |
PHP_SELF | /vufind/index.php |
PHP_AUTH_USER | |
REQUEST_TIME_FLOAT | 1744204383.788 |
REQUEST_TIME | 1744204383 |