Welcome Guest, Not a member yet? Register   Sign In
Maintain session access in models
#1

[eluser]DougW[/eluser]
I am auto-loading the session library and using it with custom user data. How do I make the session array available in a model when it was auto-loaded by autoload or the primary controller?

$this->session->set_userdata('item','value')

doesn't seem to work at model level. Do I have to reload the library in the constructor of the model?
#2

[eluser]WanWizard[/eluser]
Should work wihout problems. Do you correctly extend the model, and call the parent constructor in your model?
Code:
class test_model extends Model
{
    function test_model()
    {
        parent::Model();
    }

    // your stuff here...
}
#3

[eluser]DougW[/eluser]
Never mind... stupid typo. It is working fine.

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB