Welcome Guest, Not a member yet? Register   Sign In
Passing Data Between Views without saving it to cookies
#4

[eluser]marcogmonteiro[/eluser]
i don't know how big the data is, but you can just make an array of data like this:
Code:
$newdata = array(
                   'username'  => 'johndoe',
                   'email'     => '[email protected]',
                   'logged_in' => TRUE
               );

$this->session->set_userdata($newdata);


and then to retrive the data just use:

Code:
$this->session->userdata('username');

to use database with sessions in CI just check the userguide here:

http://ellislab.com/codeigniter/user-gui...sions.html

On the part that says saving session data in database.

this way you can retrive the data anywhere even directly in the view...


Messages In This Thread
Passing Data Between Views without saving it to cookies - by El Forum - 06-15-2011, 03:29 PM
Passing Data Between Views without saving it to cookies - by El Forum - 06-15-2011, 03:38 PM
Passing Data Between Views without saving it to cookies - by El Forum - 06-15-2011, 03:43 PM
Passing Data Between Views without saving it to cookies - by El Forum - 06-15-2011, 03:48 PM
Passing Data Between Views without saving it to cookies - by El Forum - 06-15-2011, 03:59 PM
Passing Data Between Views without saving it to cookies - by El Forum - 06-15-2011, 04:02 PM
Passing Data Between Views without saving it to cookies - by El Forum - 06-15-2011, 08:20 PM
Passing Data Between Views without saving it to cookies - by El Forum - 06-15-2011, 10:30 PM
Passing Data Between Views without saving it to cookies - by El Forum - 06-15-2011, 10:57 PM
Passing Data Between Views without saving it to cookies - by El Forum - 06-16-2011, 01:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB