[eluser]daelsepara[/eluser]
take note too that when using cookies (whether native PHP cookies or via CodeIgniter's Helper function), you must refresh the page or redirect it to a new one for the
cookie values to be active, either way, it can easily be implemented in the controller.
e.g.
Code:
//controller: sample
function index()
{
$this->load>helper('cookie'); //can also be placed in the constructor
set_cookie('test_cookie','test',0);
redirect('sample/main');
}
function main()
{
$this->load>helper('cookie'); //can also be placed in the constructor
$cookie = get_cookie('test_cookie');
//render page, i.e. load views, etc.
}