Welcome Guest, Not a member yet? Register   Sign In
Reassigning a value to a session variable
#7

[eluser]theprodigy[/eluser]
If I'm reading your code correctly, the first time through,
Code:
$failed_logins = $this->session->userdata('failed_logins');
will return a FALSE because it currently isn't in session, right?

Then why not change your last IF to
Code:
if ($failed_logins === FALSE)
{
    $this->session->set_userdata('failed_logins', 1);    
}
else
{
    $failed_logins++;
    $this->session->set_userdata('failed_logins', $failed_logins);  
}


Messages In This Thread
Reassigning a value to a session variable - by El Forum - 08-26-2012, 02:42 PM
Reassigning a value to a session variable - by El Forum - 08-26-2012, 04:17 PM
Reassigning a value to a session variable - by El Forum - 08-26-2012, 05:20 PM
Reassigning a value to a session variable - by El Forum - 08-26-2012, 05:49 PM
Reassigning a value to a session variable - by El Forum - 08-26-2012, 05:55 PM
Reassigning a value to a session variable - by El Forum - 08-26-2012, 06:48 PM
Reassigning a value to a session variable - by El Forum - 08-26-2012, 09:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB