Welcome Guest, Not a member yet? Register   Sign In
Session - Object Serialize Problem
#1

[eluser]Multisnet[/eluser]
Hello,

I'm facing a problem when I try to serialize an object and use it in a CI base session. Someone have this working?

A brief example of my code.

In the same controller:

Code:
function Page1(){
$this->load->model('people', 'people');
$this->people->definePeople(...);
$people_serialized = array('people_s' => serialize($this->people));
$this->session->set_userdata($people_serialized);
}

function Page2(){
$this->load->model('people', 'people');
print_r($this->session->userdata('people_s'));
}

It prints nothing! However if I change the $people_serialized = array('people_s' => 'TEST!!!!!') in the second page it prints the word "TEST!!!!!!".

Is it possible to use serialization on CI Sessions? Please help me.. I'm tired of trying to resolve this :down:

Thanks in advance


Messages In This Thread
Session - Object Serialize Problem - by El Forum - 06-29-2009, 09:10 AM
Session - Object Serialize Problem - by El Forum - 06-29-2009, 09:54 AM
Session - Object Serialize Problem - by El Forum - 06-29-2009, 09:59 AM
Session - Object Serialize Problem - by El Forum - 06-29-2009, 10:02 AM
Session - Object Serialize Problem - by El Forum - 06-29-2009, 10:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB