I’ve started using Tank Auth in my CodeIgniter App, I have followed some tutorial steps to set it up, and as long as it works, it produces lots of error messages during account activation and logout. Here are the errors:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: session_id
Filename: libraries/Session.php
Line Number: 272
A PHP Error was encountered
Severity: Notice
Message: Undefined index: ip_address
Filename: libraries/Session.php
Line Number: 272
A PHP Error was encountered
Severity: Notice
Message: Undefined index: user_agent
Filename: libraries/Session.php
Line Number: 272
A PHP Error was encountered
Severity: Notice
Message: Undefined index: last_activity
Filename: libraries/Session.php
Line Number: 272
A PHP Error was encountered
Severity: Notice
Message: Undefined index: session_id
Filename: libraries/Session.php
Line Number: 288
A PHP Error was encountered
Severity: Notice
Message: Undefined index: last_activity
Filename: libraries/Session.php
Line Number: 289
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /projekt/system/core/Exceptions.php:185)
Filename: libraries/Session.php
Line Number: 675
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /projekt/system/core/Exceptions.php:185)
Filename: helpers/url_helper.php
Line Number: 542
Here’s the code at the reference points:
foreach (array('session_id','ip_address','user_agent','last_activity') as $val)
{
unset($custom_userdata[$val]);
$cookie_userdata[$val] = $this->userdata[$val]; //272 line
}
$this->CI->db->where('session_id', $this->userdata['session_id']); //288 line
$this->CI->db->update($this->sess_table_name, array('last_activity' => //289 line $this->userdata['last_activity'], 'user_data' => $custom_userdata));
setcookie( // 675 line $this->sess_cookie_name, $cookie_data, $expire, $this->cookie_path, $this->cookie_domain, $this->cookie_secure );
It does not look like these errors are serious ones as they are still only on the notice level of the error hierarchy. I would look at the source code of code-igniter and see what’s up. The source is worth understanding how to edit and navigate, as it will save time later. Since I have not used Tank Auth I’m not sure what the exact problem is. I would advise setting up var_dump statements in your source to track what it going on. It does look like some either model or session variables do not exist in the context of your library or what ever other third party tool you are using. You might need to declare an instance of codeigniter in order to work with these third party tools as they exist outside the scope of codeigniter.
You can check out more at this tutorial under the section: Utilizing CodeIgniter Resources within Your Library
http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html