In my project,I am trying to fetch get values and set session value by this
function set_uri_session(){ $id=$this->uri->segment(3); $this->session->set_userdata('id',$id); echo $this->session->userdata('id'); } </php>
when I print this session value in that page itself, I got the value correctly.and when I click on the particular link and then print that data, I am getting the value like ‘images’.
The session variable always get value ‘images’. Then i realize that: if we made a session variable, then we must call redirect() directly.
wrote another function and set the session and redirect to above function doing like this sole this issue
<?php function set_session(){ $id=$this->uri->segment(3); $this->session->set_userdata('id',$id); redirect('set_uri_session'); } function set_uri_session(){ $id=$this->uri->segment(3); $this->session->set_userdata('id',$id); echo $this->session->userdata('id'); } </php>



