Codeigniter会话:无法将值存储到控制器的会话中

When I try to insert some value into session from a controller function, it doesn't store the value.

I don't have the problem in storing session when checking login. But in another controller (I try to save into session to enable searching) and try printing the value in another controller, the ones that are recently inserted goes blank.

Its weird because I have followed all the rules of assigning values to session in Code Igniter.

The controller code is

$this->session->set_userdata("langId",$lang[0]->languageId);   
$this->session->set_userdata("direction",$lang[0]->direction);

Try this should work

$this->session->set_userdata("langId",$lang->languageId);
$this->session->set_userdata("direction",$lang->direction);