Welcome Guest, Not a member yet? Register   Sign In
Can't load session in library
#1

[eluser]Unknown[/eluser]
I have a library called "Layout" which controls the main layout for my site. In my header method I have this code that checks to see if the "loggedin" variable is set and then loads a view depending on the outcome.

Code:
$loggedin = 0;
        if($loggedin)
        {
            $aData['myAccount'] = '<div class="my_account">';
            $aData['myAccount'] .= $this->load->view('account/myaccount', '', true);
            $aData['myAccount'] .= '</div>';
        }
        else
        {
            $aData['myAccount'] = '<div class="login_or_register">';
            //Assign the login view to the $aData array for display
            $aData['myAccount'] .= $this->load->view('account/login', '', true);
            $aData['myAccount'] .= '</div>';
        }

This works but what I want to do is to check if a session variable is set. However it's not possible to load the session library from within another library. Is there a way round this problem?

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB