Welcome Guest, Not a member yet? Register   Sign In
Auth/myth - before filter - redirect login
#2

(This post was last modified: 08-03-2020, 09:36 AM by InsiteFX.)

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 )
Reply


Messages In This Thread
RE: Auth/myth - before filter - redirect login - by InsiteFX - 08-03-2020, 09:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB