Hi Djulia,
In regards to zero-byte session file cleanup:
That does not seem to function on our server. The files continues to accumulate.
But, it is perhaps because of an incomprehension of my share or the configuration of the server.
It doesn't erase 0 byte files that already exist, it should just prevent new 0 byte files from being created by CMSB that use the new code. Also, keep in mind that your session folder might be shared by multiple domains. So the 0 bytes files might be coming from others domains or other non-CMSB scripts on your domain.
Can you try the following test script?
<?php // session_removed_test.php
error_reporting(E_ALL | E_STRICT); // display all errors
ini_set('display_errors', '1');
// start session
print "<h1>Session file Removed Test</h1>\n";
session_start() or die("Couldn't start session! '$php_errormsg'!");
$_SESSION = array();
$sessionPath = ini_get('session.save_path'). "/sess_" . session_id();
//
if (@$_REQUEST['remove']) {
print "Automatic Removal - Removing empty session files.<br/>\n";
print "Check if session file exists here (it should NOT exist): $sessionPath<br/>\n";
print "then try <a href='?'>default PHP behaviour</a><br/>\n";
function _remove_empty_session_file() { if (!@$_SESSION && session_id()) { session_destroy(); }}
register_shutdown_function('_remove_empty_session_file'); // remove session file on shutdown
}
else {
print "Default PHP - Not removing empty session files.<br/>\n";
print "Check if session file exists here (it should): $sessionPath<br/>\n";
print "then try <a href='?remove=1'>automatic removal</a><br/>\n";
}
?>
Or if that doesn't work, email me at dave@interactivetools.com so I can take a look. I'd like to make sure this works for 2.52. Thanks!
Dave Edis - Senior Developer
interactivetools.com