Reassigning a value to a session variable |
[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');
[eluser]theprodigy[/eluser]
Since it isn't doing what you want it to do, what is it doing?
[eluser]xtremer360[/eluser]
I redid the submit function and here's the section of code being questioned. When it gets down to the else statement were I have the var_dump on the $failed logins varible it keeps coming back with bool(false). I should be set when I set it to 1 on the first login attempt. Code: $regenerated_post_password = $this->functions_model->regenerate_password_hash($post_password, $user_data->password_hash);
[eluser]theprodigy[/eluser]
I don't really see anything wrong with your code. Are you having CI store session in a db, and if so, have you kept an eye on your ci_session table to make sure it's not making a new session each time, and thereby no keeping track of your failed_logins value? Another thing to check is everywhere you might be unsetting the session value. I see it once in your first IF condition. Do you happen to have it anywhere else that may be removing it?
[eluser]xtremer360[/eluser]
I don't have it unsetting anywhere else. Here's the full code. Thanks for the reply. http://pastebin.com/M1iMaQmq
[eluser]xtremer360[/eluser]
With some debugging I tested the if statement on 122 of the pastebin and it proved to be true so for some reason this line of code doesn't run. Code: $this->session->set_userdata('failed_logins', 1);
[eluser]theprodigy[/eluser]
If I'm reading your code correctly, the first time through, Code: $failed_logins = $this->session->userdata('failed_logins'); Then why not change your last IF to Code: if ($failed_logins === FALSE) |
Welcome Guest, Not a member yet? Register Sign In |