Welcome Guest, Not a member yet? Register   Sign In
CI 4 simple session auth system problem
#2

(This post was last modified: 10-31-2019, 12:40 PM by dave friend.)

Remove the following line from BaseController. It is not needed because the session library does this for you.

PHP Code:
$this->session->start(); 

That may be the reason $this->session is coming up null.


Try this change for loggedIn()

PHP Code:
protected function loggedIn()
{
    if ($this->session->has('loggedIn'))
    {
        return redirect()->to(base_url('dashboard/index'));
    }

    // then not logged in
    return redirect()->to(base_url('auth/index'));


Then you can remove public function notLoggedIn()
Reply


Messages In This Thread
RE: CI 4 simple session auth system problem - by dave friend - 10-31-2019, 12:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB