CodeIgniter Forums
Strange value in session cookie - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Strange value in session cookie (/showthread.php?tid=10041)



Strange value in session cookie - El Forum - 07-17-2008

[eluser]Unknown[/eluser]
Hi!
I am doing something like this in my controller:
Code:
function set_family()
    {
        $family_id=$this->uri->segment(3);
        $this->session->unset_userdata('person_family_id');
        $this->session->set_userdata(array('person_family_id'=>$family_id));
        $this->load->view('gallery_view',$this->_set_view_data(0));
    }
The $family_id is then a number 1 or 2 in my session.
After this, in my view, wen I click on link, I am doing this action:
Code:
function upload()
    {
        $family_id = $this->session->userdata('person_family_id');
    }
But, in function upload(), value of $family_id is not a number, but string 'js'.
Between set_family_action and upload action I dont modify anything in session data. So why I dont have number 1 or 2, but instead of this, string 'js'?
I have to add, that first, in other controller, I initialize the value of family_id in session. Could it be, that when the value in cookie is set in one controller, it cant be set to other value in other controller? I think, that when I initialize session in first controller, i can't modify values of cookie in other controller. Am I correct?