CodeIgniter Forums

Full Version: How to implement 3 times login attempts with a 15 minutes login blockage at incorrect entries. (CI + smarty)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
Hi,

I am using smarty + code igniter. I am trying to develop an application, where after 3 invalid login attempts the user should be blocked for 15 mins (or for a certain period of time). Also, if he tries to login after he has been blocked, a message shud appear stating the remaining time duration (message may be like- " After 10 minutes, you can try login.", after 3 minutes - " After 7 minutes, you can try login.",).
Hope to get some positive feedbacks !Smile

El Forum

[eluser]Dam1an[/eluser]
In order to get the most help possible, you should always post what you've tried so far, or if its still in the idea stage, what potential solutions you've come up with etc.

(Although you've done much better then some people who just say "GIVE ME CODE TO DO XYZ")

I'd recommend logging the failure ina database with the username, time of failure and failure count, if they fail again, incremement the count and update the timestamp.

When a user tried to login, check this table, if the fail count is 3 and timestamp is less then 15 minutes ago, show the error, else proceed as normal