I'm having a slight problem that i can't understand, i'm building a Web Server that handles calls in the java E.G go to use /SendCommand.html then Java will handle the request, i have a login system built using post, but for some reason my login check is not working,
private boolean checkLogin(String user, String pass){
for(int i = 0; i < users.users.length; i++ ){
String test = SHA1.toSHA1(pass);
if(users.users[i][0] == user && users.users[i][1] == test ){
return true;
}
}
return false;
}
I'm Breaking at the if statment to provide the information below When i debug this i get,
Name | Type | Value
users Users #163
users String[] #165(length=1)
[0] String[] #167
[0] String "Admin"
[1] String "d033e22ae348aeb5660fc2140aec35850c4da997"
user String "Admin"
pass String "admin"
test String "d033e22ae348aeb5660fc2140aec35850c4da997"
As you can see users.users[0][0] == user
and users.users[0][1] == test
why is it returning false from the method?