3 * Allow programs to request this object from WebRequest::response()
4 * and handle all outputting (or lack of outputting) via it.
10 * Output a HTTP header, wrapper for PHP's
12 * @param $string String: header to output
13 * @param $replace Bool: replace current similar header
15 public function header($string, $replace=true) {
16 header($string,$replace);
19 /** Set the browser cookie
20 * @param $name String: name of cookie
21 * @param $value String: value to give cookie
22 * @param $expire Int: number of seconds til cookie expires
24 public function setcookie( $name, $value, $expire = 0 ) {
25 global $wgCookiePath, $wgCookiePrefix, $wgCookieDomain;
26 global $wgCookieSecure,$wgCookieExpiration, $wgCookieHttpOnly;
28 $expire = time() +
$wgCookieExpiration;
30 $httpOnlySafe = wfHttpOnlySafe();
32 'setcookie: "' . implode( '", "',
34 $wgCookiePrefix . $name,
40 $httpOnlySafe && $wgCookieHttpOnly ) ) . '"' );
41 if( $httpOnlySafe && isset( $wgCookieHttpOnly ) ) {
42 setcookie( $wgCookiePrefix . $name,
50 // setcookie() fails on PHP 5.1 if you give it future-compat paramters.
52 setcookie( $wgCookiePrefix . $name,