I have a no-framework web application. I need to implement a simple way to check unsuccessful logins, using sessions. If the user attempts to log in 3 times using incorrect
You can try the below code
int loginAttempt = (Integer)session.getAttribute("loginCount"); if (loginAttempt > 3 ){ // Error message/page redirection }else{ session.setAttribute("loginCount",loginAttempt++); }