Welcome Guest, Not a member yet? Register   Sign In
Where to declare global variables?
#11

[eluser]pickupman[/eluser]
I would recommend using sessions as well. Just make sure that your session length will exceed the time expected for them to clear the data from your UI button.
#12

[eluser]runrun[/eluser]
post7 is what I was looking for a long time.
#13

[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.
}




Theme © iAndrew 2016 - Forum software by © MyBB