I've got a working custom session handler for MySQL, but I can't get the script to obey my ini_set clauses. The main problem I'm facing is in regards to the session expiration; if I ini_set the session.gc_maxlifetime to 60 (for testing purposes only), the handler reverts to the server default (1440 on my server). Any thoughts as to why the handler won't recognize the ini_set commands? Some facts about my setup:
i've got a separate file for all my ini_set clauses which is included on all pages
php5, apache 2.2.2
Here's my write function in the session handler
function mysql_session_write($sid, $value) {
$lifetime = get_cfg_var("session.gc_maxlifetime");
$expiration = time() + $lifetime;
$query = "INSERT INTO sessions
VALUES('$sid', '$expiration', '$value')";
$result = mysql_query($query);
if (!$result) {
$query = "UPDATE sessions SET
expiration = '$expiration',
value = '$value' WHERE
sid = '$sid' AND expiration >". time();
$result = mysql_query($query);
}
}
Thanks in advance for any advice! -chris