![]() |
Session store - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Session store (/showthread.php?tid=9983) |
Session store - El Forum - 07-15-2008 [eluser]babai[/eluser] I want to store the session in Array. Now session are storing by default into CI_Session Object. Actual I have print ( print_r($this->session); ) the session and getting the result. See the example CI_Session Object ( [now] => 1216134421 [encryption] => [use_database] => 1 [session_table] => ci_sessions [sess_length] => 1800 [sess_cookie] => ci_session [userdata] => Array ( [username] => sudip [user_id] => 1 [full_name] => Sudip Samanta [power_user] => y [s_home_dir] => . [twg_permissions] => 7 [upload_settings] => 15 [mywebgallerie_login] => ok [s_user] => admin [admin_lang] => en ) } But I want to store some session data into an Array. Means I want to split the previous example into 2 parts. See the example 1. CI_Session Object ( [now] => 1216134421 [encryption] => [use_database] => 1 [session_table] => ci_sessions [sess_length] => 1800 [sess_cookie] => ci_session [userdata] => Array ( [username] => sudip [user_id] => 1 [full_name] => Sudip Samanta [power_user] => y ) } 2. Array ( [s_home_dir] => . [twg_permissions] => 7 [upload_settings] => 15 [mywebgallerie_login] => ok [s_user] => admin [admin_lang] => en } Is it possible? If it is possible so how to store into the session. Now I am using '$this->session->set_userdata('admin_lang', 'en')'. Session store - El Forum - 07-15-2008 [eluser]hvalente13[/eluser] [quote author="babai" date="1216154563"]I want to store the session in Array. Now session are storing by default into CI_Session Object. Actual I have print ( print_r($this->session); ) the session and getting the result. See the example [/quote] Quote:2. You can get the session data by using: Code: $my_array = array( And to store data into CI Session object it's how you have been doing: Code: $this->session->set_userdata('admin_lang', 'en') Good luck Session store - El Forum - 07-15-2008 [eluser]babai[/eluser] No, I want to store the data into session out side of CI Session object. If I print print_r($_SESSION); that will be display Array ( [s_home_dir] => . [twg_permissions] => 7 [upload_settings] => 15 [mywebgallerie_login] => ok [s_user] => admin [admin_lang] => en } Not display the CI Session object ( [s_home_dir] => . [twg_permissions] => 7 [upload_settings] => 15 [mywebgallerie_login] => ok [s_user] => admin [admin_lang] => en } I mean when I will set a data into session it will not store into CI Session object. It will be store into global session array. |