[eluser]WanWizard[/eluser]
The userdata() method of the session class returns FALSE if the variable does not exist, otherwise it returns the stored value.
I think the issue is that empty() is a language construct, you might not be able to use it on a method call. In that case (assuming that you store 0 and 1), you can just use
Code:
if ( ! $this->session->userdata(‘authenticated’) )
{
redirect(‘login’);
}
taking advantage of the fact that 0 evaluates to false.