Search code examples
kohanakohana-3

Kohana 3.3 Auth - how to log in every guest?


What is my goal: every guest (user which has not got token in DB) should be displayed as logged in as some account, let's say "test". And he can do everything like normal user (because he is). But he can just log off and turn to another account or browse site anonymously.

Is it possible to do it with stock Kohana 3.3 Auth? I need this to finish my google adsense approval process.


Solution

  • Put this line at the start of the parent controller:

    Auth::instance()->login('test', 'test', false);