X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FWebResponse.php;h=26fb20f331b2cc4fbb00d225b6af0c7a6adc2d35;hb=80a3c6eb611e27e479d7951feea4aac7473557e1;hp=bb7682d3e8324e291bdf827c9f5550e1b2f6d785;hpb=bacc11eb30ddf01624d5448f432b96afdae67c28;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebResponse.php b/includes/WebResponse.php index bb7682d3e8..26fb20f331 100644 --- a/includes/WebResponse.php +++ b/includes/WebResponse.php @@ -136,6 +136,19 @@ class WebResponse { $options['httpOnly'] ); } } + + /** + * Unset a browser cookie. + * This sets the cookie with an empty value and an expiry set to a time in the past, + * which will cause the browser to remove any cookie with the given name, domain and + * path from its cookie store. Options other than these (and prefix) have no effect. + * @param string $name Cookie name + * @param array $options Cookie options, see {@link setCookie()} + * @since 1.27 + */ + public function clearCookie( $name, $options = array() ) { + $this->setCookie( $name, '', time() - 31536000 /* 1 year */, $options ); + } } /**