[eluser]jordanarseno[/eluser]
Hello All,
In accordance with keeping things as DRY as possible, I have removed method instances of an
is_logged_in() function from all of my Controllers, and migrated it to my base controller,
MY_Controller. Since the
MY_Controller __construct() method is called on every page load, no matter which Controller, I figured this is the best place for it.
Thus, I have the following in
MY_Controller's
__construct():
Code:
$this->is_logged_in();
So far so good. Because of the $this psuedovariable, my class expects a function called
is_logged_in() within
MY_Controller. Below is it's implementation:
Code:
function is_logged_in()
{
$is_logged_in = $this->session->userdata("is_logged_in");
if(!isset($is_logged_in) || $is_logged_in == FALSE)
{
redirect('/login/');
}
}
I get the attached Firefox error.
The issue is with the
redirect() function, if I comment it out and replace it with an echo, all is well - except it does not redirect - obviously what I need it to do!
If I instead use
$this->load->view("login_view");, then
TWO login_view's are shown on the page!
Your help is appreciated - Thanks in advance,
JoAr