Fixes a bug again
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user