I have this problem on a PHP website that I made. The website uses a login mechanism I got online. This mechanism has a .php script called "checklogin.php". My problem is with the method it uses to check if the login is valid or not. Basically what its uses is this:
<?php
session_start();
if(isset($_SESSION['myusername'])){
//run my site
}
else {header("location:../main_login.php")
?>
but this code returns true for all users, if there is at least one user logged in.
my question is that; is there a way to compare $_SESSION['myusername'] with the username given at login page, or if there is anything to make MySQL session unique.
Excuse my English and Grammar.