Welcome Guest, Not a member yet? Register   Sign In
Is session->userdata supposed to return an array?
#1

[eluser]Unknown[/eluser]
Code:
$id = 1;
$custom_session_data = array('id' => $id);
$this->session->set_userdata($custom_session_data);
$id = $this->session->userdata('id');
print_r($id);
Array ( [0] => stdClass Object ( [id] => 1 ) )
I was hoping to get the data as int/str. Am I doing something wrong or this is supposed to be like this? If yes, then is there a way to extract the wanted int without getting 'messy'?


Messages In This Thread
Is session->userdata supposed to return an array? - by El Forum - 08-17-2010, 06:48 PM
Is session->userdata supposed to return an array? - by El Forum - 08-18-2010, 02:14 AM
Is session->userdata supposed to return an array? - by El Forum - 08-18-2010, 05:58 AM
Is session->userdata supposed to return an array? - by El Forum - 08-18-2010, 07:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB