I have successfully implemented the onUserAuthenticate
event to implement my custom authentication API inside the Joomla! site that I am working on.
Now I want to also have some custom code run on the onUserLogout
event.
I have added the following code to the custom authentication plugin file.
But this method is not getting fired/invoked while the previous one(onUserAuthenticate
) is working just fine.
/**
* Method to handle the SSO logout
*
* @param array $user Holds the user data.
* @param array $options Array holding options (client, ...).
*
* @return boolean Always returns true.
*
* @since 1.6
*/
public function onUserLogout($user, $options = array()) {
if (JFactory::getApplication()->isSite()) {
// Set the cookie to expired date.
setcookie('customAuth', '123', time() - (60 * 60 * 24 * 365), '/', '.customdomain.org');
}
return true;
}