3 * Allow programs to request this object from WebRequest::response()
4 * and handle all outputting (or lack of outputting) via it.
8 /** Output a HTTP header */
9 function header($string, $replace=true) {
10 header($string,$replace);
13 /** Set the browser cookie */
14 function setcookie( $name, $value, $expire = 0 ) {
15 global $wgCookiePath, $wgCookiePrefix, $wgCookieDomain;
16 global $wgCookieSecure,$wgCookieExpiration, $wgCookieHttpOnly;
18 $expire = time() +
$wgCookieExpiration;
20 $httpOnlySafe = wfHttpOnlySafe();
22 'setcookie: "' . implode( '", "',
24 $wgCookiePrefix . $name,
30 $httpOnlySafe && $wgCookieHttpOnly ) ) . '"' );
31 if( $httpOnlySafe && isset( $wgCookieHttpOnly ) ) {
32 setcookie( $wgCookiePrefix . $name,
40 // setcookie() fails on PHP 5.1 if you give it future-compat paramters.
42 setcookie( $wgCookiePrefix . $name,