Welcome Guest, Not a member yet? Register   Sign In
how to use Saving Session Data to a Database
#2

[eluser]pickupman[/eluser]
You use the same syntax when using the session library regardless of storage. It's your config file determines where the session is stored. Either way you use:
Code:
$this->session->set_userdata('some_key','This is a string'); //store a value in session
$this->session->userdata('some_key'); //returns 'This is a string';

$this->session->set_flashdata('some_key','Available on the next request page only'); //store a flash variable
$this->session->flashdata('some_key'); //returns 'Available on the next request page only');

Per the user guide you can also pass a multi-dimensional array to set_userdata($array) and the array keys become the session key identifiers, and the values become the text stored in session.


Messages In This Thread
how to use Saving Session Data to a Database - by El Forum - 06-11-2010, 02:29 AM
how to use Saving Session Data to a Database - by El Forum - 06-12-2010, 08:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB