会话不在CI的其他控制器中工作

I set session in login() controller where login user details is set in session. session library is autoload .

$data = $this->login_model->login_admin();

$this->session->set_userdata('UserLoggedInDetails',$data); //set login user details

when we do var_dump($this->session->userdata('UserLoggedInDetails'));//it prints all login user details in same controller

but when we do it in other controller or in same controller in other function-

var_dump($this->session->userdata('UserLoggedInDetails'));

it prints array(0) { }

my config file is-

$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration']  = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie']  = FALSE;
$config['sess_use_database']    = FALSE;
$config['sess_table_name']  = 'ci_sessions';
$config['sess_match_ip']    = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update']  = 300;

I search all previous asked question like this but not solve this issue ...Please Help Me out .. All Suggestion are welcome . Thanks In Advance.

The problem is because you are not saving your session data in database. SO that going to save in cookie. We all know cookie has a limit 4KB. So save your session data array in data base like below tutorial shown in codeigniter user guide.

http://codeigniter.com/user_guide/libraries/sessions.html

update the following in your code it worked for me:

$config['sess_expiration']  = 8600;
$config['sess_match_useragent'] = FALSE;