Fixes a bug again

This commit is contained in:
2023-01-28 17:39:24 -05:00
parent c3add26c40
commit abe72ab575
2 changed files with 1 additions and 2 deletions

View File

@@ -93,7 +93,7 @@ if (array_key_exists("username", $_POST) and array_key_exists("type", $_POST) an
$Cookie = sanitize(substr(sha1($Cookie), 5));
$CookieForDB = [$Cookie, $USERNAME, $Time, $address];
dbAdd($CookieForDB, "cookies");
setcookie("user", $Cookie, $path="/");
setcookie("user", $Cookie, $Time, "/");
echo json_encode($Cookie);
// Checks if the password has to be rehashed
if (password_needs_rehash($RESULT, PASSWORD_BCRYPT, $OPTIONS)) {

View File

@@ -316,7 +316,6 @@ if (array_key_exists("user", $_COOKIE)) {
if ($USERNAME) {
// Makes sure that the database knows who last accessed that session
dbCommand("UPDATE cookies SET lastIP='$address' WHERE cookie='$COOKIEID'");
setcookie("user", $COOKIEID, $path="/");
$USERNAME = $USERNAME[0];
$PRIVILEGES = dbRequest("privilege", "privileges", "username", $USERNAME, 0);
if (!$PRIVILEGES) {