codeigniter session issue : Codeigniter Session Value As Images?

Share on TwitterDigg This

codeigniter session

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>

Related

About prabin t p

Connect with me on Google+
This entry was posted in codeigniter and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">