Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Auth::check() is run twice?
  • Today I ran into something strange.
    When fiddling around with FUEL, I discovered that Auth::check() is run two times.
    It seems that Auth::check() can not remember static::$_verified. The first time Auth::check() is run, static::$_verified is always empty.
    Auth::check() then calls driver::check() which calls SimpleAuth::check(). If SimpleAuth::check() returns TRUE, Auth::check() will run again and stop on line 189 -- return TRUE.
    The user is then logged in. If SimpleAuth::check() returns FALSE, Auth::check() will call driver::check() again which calls SimpleAuth::check() again.
    All checks() return FALSE and the user is then not logged in. Can somebody explain to me this strange behaviour?
    It was driving me nuts when I kept seeing my echo 'debug info' twice... Thanks on beforehand,
    jeroen
  • The Auth package does an automatic check for the default instance, when it is loaded ( in auth/classes/auth.php, method _init() ).
  • Harro Verton wrote on Sunday 7th of August 2011:
    The Auth package does an automatic check for the default instance, when it is loaded ( in auth/classes/auth.php, method _init() ).

    So the double check is default behaviour and I shouldn't worry about it? Thanks!
  • I would say it's worth looking into, because it should not be needed. I can't comment on it without diving into the code, maybe it's something for Jelmer, as he wrote it...

Howdy, Stranger!

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

In this Discussion