backend/functions.php find and replace.
function logincookie($id, $password, $secret, $updatedb = true, $expires = null) {
if ($expires === null) {
$expires = time() + (30 * 24 * 60 * 60); // Extend 30 days from now on each visit
}
$hash = sha1($id . $secret . $password . getip() . $secret);
// Set secure cookies with a rolling expiration
setcookie("pass", $hash, $expires, "/", "", true, true);
setcookie("uid", $id, $expires, "/", "", true, true);
if ($updatedb) {
$stmt = $GLOBALS["DBconnector"]->prepare("UPDATE users SET last_login = ? WHERE id = ?");
$stmt->bind_param("si", get_date_time(), $id);
$stmt->execute();
$stmt->close();
}
}
function logoutcookie() {
setcookie("pass", "", time() - 3600, "/", "", true, true);
setcookie("uid", "", time() - 3600, "/", "", true, true);
}
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2025-04-26 20:28:29
