CodeIgniter Forums

Full Version: keep multidimensional session value
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
Hi
i have a session like this:
Code:
Array
(
    [session_id] => 4a5a5dca22728fb0a84364eeb405b601
    [ip_address] => 127.0.0.1
    [user_agent] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7;
    [last_activity] => 1303142623
    [data] => array(
                                 [user_name] => 'admin',
                                 [user_type] => 'test',
    )
)

for keep session_id i use:
Code:
$this->session->userdata('session_id');

while for keep "user_name" value?


regards
Denny3d

El Forum

[eluser]InsiteFX[/eluser]
Make data a text field and serialize the array then you can save it as a string.

El Forum

[eluser]Unknown[/eluser]
ok, but i found a method to keep directly a value from session array into view and i dont foreach into controller.
there is a way to do it?