First of all, if you have a CAs, and if you have a PHP project in the CAs, this time to let the PHP project has the CAS SSO function, you need to transform your project, because each individual project is different, but the principle is similar, all through the CAS server to obtain Session_ticket, Then according to the ticket to the CAS server to obtain user information and into the project log in.
PHP's CAS client phpcas can do this, but a pit is casphp::handlelogoutrequests () This function is used to check the Java side logout when the PHP side also exits, If you do not look at the casphp source, you will not know how big the pit of this function is.
First, if you use Casphp::handlelogoutrequests () directly to determine the Java side exit and PHP side exit, if your project is not on the public network, so no problem, but if your project is on the public network, This function will make an error (see your Phpcas.log file for information) and will show no logout request in the diary. By looking at the source code you know that you need to set casphp::handlelogoutrequests () to Casphp::handlelogoutrequests (True,array ("Java Project Server IP")); This phpcas will intercept the log out of the information, and then log out, but this is just the CAS server logout, your own PHP project to modify the code according to the circumstances of your own project, I was judged by Phpcas:: Checkxxxx () The return value of this method to modify the logout logic code.
The above is for reference only!
Phpcas::handlelogoutrequests () on the Java-side project logout and the PHP-side project does not detect the test