I check if the user variables $_SESSION are populated, and if the login is correct. This is my code:
if(!empty($_SESSION['user'])&&!empty($_SESSION['pwd'])&&!verifyLogin($_SESSION['user'],$_SESSION['pwd'])){
$_SESSION['user'] is the username, $_SESSION['pwd'] is the password, verifyLogin() is my function to verify user login.
Why does my if statement return true even if $_SESSION['user/pwd'] empty? Shouldn't I go back?
Even if I do this:
if(!empty($_SESSION['user'])&&!empty($_SESSION['pwd'])&&verifyLogin($_SESSION['user'],$_SESSION['pwd'])==false){
I still get the same result.
What am I doing wrong?
source share