[Solar-talk] Verifying Login Status

Antti Holvikari anttih at gmail.com
Thu Feb 7 16:14:23 CST 2008


On Feb 8, 2008 12:08 AM, Sean Montague <scene at themountainscene.com> wrote:
> Thanks, I am now really look forward this. To bring it full circle, and
> for any future reference for someone new to this, my logout script looks
> like:
>
> public function actionIndex() {
>     // Register a Solar_User object if not already.
>     // This will trigger the authentication process.
>     if (! Solar_Registry::exists('user')) {
>         Solar_Registry::set('user', Solar::factory('Solar_User'));
>     }
>
>     $user = Solar_Registry::get('user');
>     $user->auth->processLogout();
>
>     // For testing, I check anyway
>     if ($user->auth->isValid()) {
>         // user is logged in
>     } else {
>         $this->output = "You have successfully signed out!";
>     }
> }

No need to call processLogout(). Solar_Auth_Adapter::start() handles
that too. You're now calling processLogout() twice.

-- 
Antti Holvikari <http://anttih.com>


More information about the Solar-talk mailing list