I have controller example name by test.
In index method I will make session, it will store in database successfully, but when I want to read them in other method, it will make another session in database. For example:
public function index(){
$this->session->set_userdata('test','test');
}
public function test(){
echo $this->session->userdata('test');
}
It will echo nothing. And when I check the database, it made new row.
echofrom your controller propagates to your view, butvar_dump($this->session->userdata('test'))does. So as @Tobias: what's the output from var_dump?