• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI 4 simple session auth system problem

#2
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.