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

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -