Welcome Guest, Not a member yet? Register   Sign In
Using the Sessiong class
#1

[eluser]RandyJP[/eluser]
Hello, Its my first time using codeigniter and also this class. I have the CI_session table in my database and I'm adding some custom data to the array that de new session creates.

Code:
$newdata = array(
                                'tipo_usuario'  => $tipo['tipo'],//Add  the user type

                                'habitacion'   => $tipo['habitacion'],//Add the room

                                'usuario'      => true               //creo the session  
                                             );
                            $this->session->set_userdata($newdata);


this is ok, and I can get anything from the array as long as its call within the same controller that created it. But this array is suppose to run globally as long as I initialize the Session class manually in the controller constructor. But I'm doing this in and other and its not working

Code:
$hab=$this->session->userdata('habitacion'); //room number

this is suppose to return a number but I doesn't outside the controller. How do I do to have the array globally?? can I do it?


Messages In This Thread
Using the Sessiong class - by El Forum - 04-06-2012, 06:32 PM
Using the Sessiong class - by El Forum - 04-06-2012, 09:22 PM
Using the Sessiong class - by El Forum - 04-06-2012, 09:38 PM
Using the Sessiong class - by El Forum - 04-15-2012, 10:56 AM
Using the Sessiong class - by El Forum - 04-15-2012, 11:24 AM
Using the Sessiong class - by El Forum - 04-15-2012, 11:27 AM
Using the Sessiong class - by El Forum - 04-15-2012, 11:29 AM
Using the Sessiong class - by El Forum - 04-16-2012, 02:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB