You can check like this to see if they are logged in.
PHP Code:
$authenticate = Services::authentication();
// if no user is logged in then send to the login form
if ( ! $authenticate->check())
{
session()->set('redirect_url', current_url());
return redirect('login');
}
This is from a filter.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )