-1

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
          );
Malyo
  • 1,990
  • 7
  • 28
  • 51
  • 2
    Notice how every error references a line number? How do you expect us to help you if we can't see what's at that line number? – Ayush Dec 13 '12 at 21:26
  • I am having this same problem when trying to use tankauth with sessions are saved to DB, and that link/comment below does not help as it is already being used in tank auth library..wish this wasn't closed.. – CI_Guy Apr 29 '13 at 15:02
  • For what is worth, I am having the same problem right now. It works on my development environment but not in production. I gave up and set $config['sess_use_database'] to false in application/config/config.php. The tables were the same in both environments. – John Moses May 11 '13 at 22:25
  • 1
    This is probably what you are looking for: http://stackoverflow.com/a/13879589/303659 – Gerbus Nov 14 '13 at 00:39

1 Answers1

1

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.

$_CI =& get_instance(); // creates a CI instance that can exist outside of the MVC setup

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

usumoio
  • 3,500
  • 6
  • 31
  • 57