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

[eluser]xtremer360[/eluser]
Trying to figure out why when the failed_logins variable is less than the config item it doesn't increase the failed_logins variable and then reassign that number to the session userdata.

Code:
$failed_logins = $this->session->userdata('failed_logins');  
        if (is_numeric($failed_logins))
        {
            echo 'failed logins:'.$failed_logins;
            echo '<br />';
            echo 'failed_login_limit:'.$this->config->item('failed_login_limit');
            if ($failed_logins < $this->config->item('failed_login_limit'))
            {
                $failed_logins++;
                $this->session->set_userdata('failed_logins', $failed_logins);
                return FALSE;
            }
            else
            {
                $this->session->unset_userdata('failed_logins');
                return TRUE;
            }
        }
        else
        {
            $this->session->set_userdata('failed_logins', 1);
            return FALSE;
        }


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