Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
I can not retrieve the logged user
  • I instanced an Auth using a personalized driver called CoescoAuth (Auth::instance('CoescoAuth')) and in the login page I do this (Auth::instance('CoescoAuth')->login()), but when I go to another page I cannot retrieve the logged user. I've checked and in the login page, the login happens, but in another page I cannot load the user.
  • HarroHarro
    Accepted Answer
    Assuming your driver stores the correct login information in the session, you should check if your sessions are configured correctly.

    Most common issue is incorrect time or timezone settings:
    - check the server time and timezone
    - make sure the same timezone is configured in php.ini
    - make sure the same timezone is configured in your config file
    - do not define a gmt-offset in your config file
    - check if your PC time and timezone are correct

    You can quickly check if this is the issue by setting the session expiry time to 0.
  • got the same issue with SimpleAuth class, I've set session expiry time to 0 and still the same issue. 
  • How do you try to "load" the user?

  • the Auth::check() always return false



    if (Auth::check()){
    $auth = Auth::instance();
    $uid = $auth->get_user_id();
    }

  • What are you using for session store? cookies? Do you redirect directly after login? Which browser?

    If you do

    Session::set('test', 'test');

    on one page, and

    Debug::dump(Session::get('test', 'not found'));

    on another, what happens?

Howdy, Stranger!

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

In this Discussion