Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
What could be a reason user automatically logs out after login?
  • I have the following code, and whenever I call the login function, the Auth::check is performed, and the user redirected accordingly... But, if I go to the same login link again... without logging out, the Auth::check() function returns false...


    public function action_login()
        {
            
            if (Auth::check()) {
                echo 'you are logged in';   // why does this never execute??
            }
            
            $form = new LoginForm();
            $form = $form->getForm();
            
            if (Input::method() == 'POST' && Input::post('submit')) {
                $form->validation()->run();
                if (!$form->validation()->error()) {
                    $login = Model_User::login_ok( Input::post('username'), Input::post('password') );
                    if ( gettype($login) == 'object' && get_class($login) == 'Model_User' ) {
                      Auth::force_login($login->id);
                        if (Auth::check()) {
                            Response::redirect('');
                        }
                    }
                }
                $form->repopulate();
            }
            $this->template->content = View::forge("front/auth/login", array('form' => $form), false);
        }
  • HarroHarro
    Accepted Answer
    Issue with the session? No session loaded?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion