[eluser]Unknown[/eluser]
I am about to pull my hair out over this, so someone please help!
The simplest case of this is as follows:
Controller:
Code:
<?php
class Test_Controller extends CI_Controller
{
public function test_a()
{
$this->load->library('test_lib');
$this->test_lib->test();
}
public function test_b()
{
var_dump($this->session->userdata('test'));
}
}
Library:
Code:
<?php
class Test_lib
{
protected $_ci;
public function __construct()
{
$this->_ci=get_instance();
}
public function test_a()
{
$this->_ci->session->set_userdata('test',array('testdata'));
}
}
Send a request to test_controller/test_a, then to test_b. You'll see that the data that is dumped is false, instead of the expected test data.