modolabs / Kurogo-Mobile-Web

Kurogo is a PHP framework for delivering high quality, data driven customizable content to a wide range of mobile devices. Its strengths lie in the customizable system that allows you to adapt content from a variety of sources and easily present that to mobile devices from feature phones, to early generation smart phones, to modern devices and tablets
http://kurogo.org
GNU Lesser General Public License v2.1
198 stars 99 forks source link

Log out of the CAS server when logging out of Kurogo. #42

Closed adamfranco closed 12 years ago

adamfranco commented 12 years ago

This patch works because phpCAS itself calls

session_unset();
session_destroy();

in its logout() function before redirecting the user to the CAS server to log out there. That said, the following code in Session::logout() doesn't get called due to the redirect and exit() in phpCAS:

unset($this->users[$authority->getAuthorityIndex()]);
$this->setSessionVars();
$this->setLoginCookie();
session_regenerate_id(true);

Ideally, the phpCAS::logout() function should be called via a hook that runs after the Kurogo Session::logout() code has finished cleaning up the session(). Without such a hook available however, this patch is probably the best option.