function deleteExpiredSessions($maxLifeTime) { foreach (getAllDbsForSessions() as $dbInfo) { $link = $dbInfo ? connect($dbInfo) : null; if (!$link || !\database\deleteExpiredSessions($link, $maxLifeTime)) { return false; } } return true; }
function getDbForSessions($sessionId) { $key = hexdec(substr(md5($sessionId), 0, 3)); return chooseShard(getAllDbsForSessions(), $key); }