Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Fixed ion_auth_model can't access ion_auth property when auto login. #46

1 commit merged into from

2 participants


In the Ion_auth class' __construct function, it load the ion_auth_model, and then check the auto-login, when calling $this->ci->ion_auth_model->login_remembered_user(), the Ion_auth class were not finished init.

So, in the Ion_auth_model's login_remembered_user function, it can't using $this->ion_auth, the ion_auth property is null, on the line 965:

if (isset($this->ion_auth->_extra_where))

This line may cause the issue.

Sorry for my English, hope this help.


Hey dude,

Thank you for looking into this. Since CI2.0 this is an outstanding bug but I haven't been able to reproduce. Can you do me a favor and determine if the error is from the isset() check for the extra _where in the login_remembered_user() or if it is that function call. I think it is an isset check somewhere.


Yeah, it form the isset() check for the extra _where, I delete some code like:

    if (isset($this->ion_auth->_extra_where))

in login_remembered_user(), and the errors gone.

There are 2 places cause the error, the first is line 965, and the second is line 981, the update_last_login() will check $this->ion_auth->_extra_where too.


Awesome, looks great dude!

Thanks for the help, I'll test and merge sometime this weekend.


Modified a little and merged in. Thanks again dude!


I'm glad I could help. :)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  libraries/Ion_auth.php
2  libraries/Ion_auth.php
@@ -103,6 +103,8 @@ public function __construct()
//auto-login the user if they are remembered
if (!$this->logged_in() && get_cookie('identity') && get_cookie('remember_code'))
+ $CI = &get_instance();
+ $CI->ion_auth = $this;
Something went wrong with that request. Please try again.