Welcome Guest, Not a member yet? Register   Sign In
CI session class, cant handle objects?

If i do this when i login, the session will only last until i flip to another page in my app.
$userObject = new User($data->id, $data->username, $data->password);  
$this->session->set_userdata('user', $userObject);

However if i just put a string into the session similar to this:
$this->session->set_userdata('user', "logged");

The session will stay with me throughout the page.
It's as if the first method which is the one i need doesn't stick in the session?

I have this is my index.php top:

The includes.php only has the User.php atm.

Theme © iAndrew 2016 - Forum software by © MyBB