php - Session return an empty response in other functions using Codeigniter 3.1 -


this code working fine in function when session in other functions return empty response.

$id = '123';  $this->session->set_userdata('id','$id'); $get_id = $this->session->userdata('id'); print_r($get_id); 

get data in other function like.

 $get_id = $this->session->userdata('id');  print_r($get_id); 

which return empty response.

if has suggestions apppreciated!

thank you

nearly, try this.

$id = array( '123' ); <------- $this->session->set_userdata( 'id', $id ); <-------- $get_id = $this->session->userdata('id'); print_r($get_id); 

Comments

Popular posts from this blog

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -