Skip to content

Commit

Permalink
testing seesions5
Browse files Browse the repository at this point in the history
  • Loading branch information
KotsiosDimis committed Dec 17, 2024
1 parent 40a33cb commit c05c154
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function loginUser($username, $password) {
// Compare the entered password with the stored password
if ($password === $user['password']) {
$_SESSION['user_id'] = $user['id'];
$_SESSION['user_id'] = $username;
$_SESSION['user_name'] = $username;
echo json_encode(['success' => true, 'message' => 'Login successful']);
} else {
echo json_encode(['success' => false, 'message' => 'Invalid username or password']);
Expand Down Expand Up @@ -70,7 +70,7 @@ function checkSession() {
}

function isLoggedIn() {
session_start();
// session_start();

if (isset($_SESSION['user_id'])) {
return true;
Expand Down

0 comments on commit c05c154

Please sign in to comment.