Welcome Guest, Not a member yet? Register   Sign In
The Auth Library 1.0.3 - The Easiest Auth Library for CodeIgniter
#21

[eluser]Adam Griffiths[/eluser]
[quote author="suashi" date="1236646949"]Let's say our counter variable is named attempts

With that in mind you can retrieve/set the value at each login attempt like:

Code:
$current_attempts = $this->session->userdata('attempts'); // retrieve old value
$this->session->set_userdata('attempts', $current_attempts++); // set new value

Of course you should check the number of attempts before setting the new value and even before trying to login the user.

I don't know if you already did it, but you can set the expiration time for the session in the config file, it's named sess_expiration

Anyway I just came back home and I'm downloading the lib cause I want to try it out![/quote]

Of course, I've done so much coding on this and other things the past few weeks I can't remember what I've released and what's still on my machine.

If I set the session expiration to 15 minutes (the time the login attempts would be 5), wouldn't that make the whole session only last for 15 minutes?


Messages In This Thread
The Auth Library 1.0.3 - The Easiest Auth Library for CodeIgniter - by El Forum - 03-09-2009, 02:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB