Updated this to work with the latest version of MediaWiki (1.26.2)
function mw_logout() {
// IMPORANT: Replace mediawiki_db with your wiki database name
$wikiDatabaseName = "mediawiki_db";
// Goes through all cookies, if it finds a cookie starting with your database name it will unset it.
foreach($_COOKIE as $cookieKey => $cookieValue) {
if(strpos($cookieKey,$wikiDatabaseName) === 0) {
// remove the cookie
unset($_COOKIE[$cookieKey]);
// IMPORTANT: Replace .mediawiki.org with your domain name
setcookie($cookieKey, '', time() - 3600, '/', '.mediawiki.org');
}
}
}
add_action('wp_logout', 'mw_logout');