De-authorizing (Logging out) with Fat Free

1,110 views
Skip to first unread message

ian

unread,
Nov 6, 2013, 6:22:23 PM11/6/13
to f3-fra...@googlegroups.com
Ive created a simple login with F3 but don't know hot to log a user out.

How do I make a call to log a user out and destroy their session with Fat Free?

I tried something like:

//do a logout
$f3->route('GET /logout',
function($f3) {
$auth->logout();
echo 'logged out';
}
);


But no luck. Do I just destroy the session with PHP? 

Thanks.

ikkez

unread,
Nov 6, 2013, 7:11:17 PM11/6/13
to f3-fra...@googlegroups.com
That's easy ;) just use $f3->clear('SESSION');

ian

unread,
Nov 6, 2013, 7:28:20 PM11/6/13
to f3-fra...@googlegroups.com
Thanks I knew it would be something simple but couldn't find the $auth details on the Fat Free Website.
Reply all
Reply to author
Forward
0 new messages