Codeigniter在非对象上调用成员函数set_userdata()

I am getting a fatal error in a CI app that I just moved from a php4 shared host to a php5 shared host.

Fatal error: Call to a member function set_userdata() on a non-object in /home/chuck_ravenna/bob.ravennainteractive.com/system/application/helpers/authenticate_helper.php on line 13

Code in full located in the link below

https://gist.github.com/1474173

I am trying to figure out if the php version could be the issue. The site runs fine on the old server, and the new server doesn't have php4 as an option.

The specific code line thats breaking is:

    $this->session->set_userdata("admin", $user[0]["admin"]);

You can't use $this inside a helper as a helper file is just a collection of functions (no class there). To use the functionality provided by $this of controller, you'll have to do:

$ci = & get_instance();
$ci->session->set_userdata("admin", $user[0]["admin"]);

$CI =& get_instance();

$CI->load->library('session');

You are using the default configuration of Codeigniter. The problem is: NO DATABASE CONFIGURATION DONE! You must enter here: \YOUR_APPLICATION_NAME\application\config\database.php

and you must open this file with a text editor.

Set the following variables and you are done:

$active_group = "default";
$active_record = TRUE;
$db['default']['hostname'] = "127.0.0.1";
$db['default']['username'] = "root";
$db['default']['password'] = "";
$db['default']['database'] = "NameOfYourDatabase";

Are you loading the session librairy in the constructor and after the parent::__construct() instruction?