no cookie for just reading

This commit is contained in:
ProjectPatatoe 2021-03-21 13:59:39 -07:00
commit 7e709addb5
3 changed files with 6 additions and 2 deletions

View file

@ -53,6 +53,7 @@ function session($user, $pass)
if ($user_enc == "password_hash") {
if (password_verify($pass, $user_pass)) {
if (session_status() == PHP_SESSION_NONE) session_start();
if (password_needs_rehash($user_pass, PASSWORD_DEFAULT)) {
update_user($user, $pass, $user_role);
}
@ -62,6 +63,7 @@ function session($user, $pass)
return $str = '<div class="error-message"><ul><li class="alert alert-danger">ERROR: Invalid username or password.</li></li></div>';
}
} else if (old_password_verify($pass, $user_enc, $user_pass)) {
if (session_status() == PHP_SESSION_NONE) session_start();
update_user($user, $pass, $user_role);
$_SESSION[config("site.url")]['user'] = $user;
header('location: admin');