/** * Set the cookie for hiding fundraising banners. */ function setHideCookie() { global $wgNoticeCookieDomain, $wgCookieSecure, $wgNoticeHideBannersExpiration; if (is_numeric($wgNoticeHideBannersExpiration)) { $exp = $wgNoticeHideBannersExpiration; } else { $exp = time() + 86400 * 14; // Cookie expires after 2 weeks } if (is_callable(array('CentralAuthUser', 'getCookieDomain'))) { $cookieDomain = CentralAuthUser::getCookieDomain(); } else { $cookieDomain = $wgNoticeCookieDomain; } // Hide fundraising banners for this domain setcookie('centralnotice_fundraising', 'hide', $exp, '/', $cookieDomain, $wgCookieSecure); }