denno020 Posted August 28, 2011 Share Posted August 28, 2011 I've got a somewhat simple problem I think.. I'm working on a uni practical, and one of the checkpoints is to limit the number of incorrect login attempts to 2. I know I could do this very easily with session variables, however on the practical sheet, it says that we're not allowed to modify any of the partially implemented code. So I was wondering, what other ways are there to track the number of incorrect logins? If it comes to it, I will just use session variables, as it's pretty much the most sensible way I'd imagine.. but would like to know of any other possible ways.. Cheers Denno Quote Link to comment https://forums.phpfreaks.com/topic/245862-limiting-failed-login-attempts/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 28, 2011 Share Posted August 28, 2011 Using session variables to do this is not secure because all you need to do to get another chance at entering data is to drop the session id and get a new session and the bad attempt count will start at zero. You need to store the count using a method that the visitor cannot reset, such as in a database table. Quote Link to comment https://forums.phpfreaks.com/topic/245862-limiting-failed-login-attempts/#findComment-1262773 Share on other sites More sharing options...
denno020 Posted August 28, 2011 Author Share Posted August 28, 2011 thanks for the reply... Using a database, however, is well above the scope for this practical.. Is there anything simpler that I could use? I don't think there is a huge need for it being secure... Quote Link to comment https://forums.phpfreaks.com/topic/245862-limiting-failed-login-attempts/#findComment-1262777 Share on other sites More sharing options...
PFMaBiSmAd Posted August 28, 2011 Share Posted August 28, 2011 I don't think there is a huge need for it being secure... That's kind of funny. What purpose would limiting failed login attempts be used for? Quote Link to comment https://forums.phpfreaks.com/topic/245862-limiting-failed-login-attempts/#findComment-1262780 Share on other sites More sharing options...
ionutvmi Posted August 28, 2011 Share Posted August 28, 2011 You can try cookies if you are looking for something simple.... but they can be easily deleted from browser so i think a good choise will be what PFMaBiSmAd recommended. Quote Link to comment https://forums.phpfreaks.com/topic/245862-limiting-failed-login-attempts/#findComment-1262784 Share on other sites More sharing options...
voip03 Posted August 28, 2011 Share Posted August 28, 2011 you can use text file( logingAttempts.txt) to count the number of loging attempts. Quote Link to comment https://forums.phpfreaks.com/topic/245862-limiting-failed-login-attempts/#findComment-1262785 Share on other sites More sharing options...
denno020 Posted August 28, 2011 Author Share Posted August 28, 2011 Ok thanks for the replies.. We are using a txt file as our 'database', where we were checking the usernames and passwords, so I guess I could just create a new txt file in a similar way.. Thanks Denno Quote Link to comment https://forums.phpfreaks.com/topic/245862-limiting-failed-login-attempts/#findComment-1262786 Share on other sites More sharing options...
voip03 Posted August 28, 2011 Share Posted August 28, 2011 Job down. mark it, solved. Quote Link to comment https://forums.phpfreaks.com/topic/245862-limiting-failed-login-attempts/#findComment-1262803 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.