Index: trunk/phase3/includes/WebResponse.php |
— | — | @@ -43,29 +43,37 @@ |
44 | 44 | * @param $name String: name of cookie |
45 | 45 | * @param $value String: value to give cookie |
46 | 46 | * @param $expire Int: number of seconds til cookie expires |
| 47 | + * @param $prefix String: Prefix to use, if not $wgCookiePrefix (use '' for no prefix) |
| 48 | + * @param @domain String: Cookie domain to use, if not $wgCookieDomain |
47 | 49 | */ |
48 | | - public function setcookie( $name, $value, $expire = 0 ) { |
| 50 | + public function setcookie( $name, $value, $expire = 0, $prefix = null, $domain = null ) { |
49 | 51 | global $wgCookiePath, $wgCookiePrefix, $wgCookieDomain; |
50 | 52 | global $wgCookieSecure,$wgCookieExpiration, $wgCookieHttpOnly; |
51 | 53 | if ( $expire == 0 ) { |
52 | 54 | $expire = time() + $wgCookieExpiration; |
53 | 55 | } |
| 56 | + if( $prefix === null ) { |
| 57 | + $prefix = $wgCookiePrefix; |
| 58 | + } |
| 59 | + if( $domain === null ) { |
| 60 | + $domain = $wgCookieDomain; |
| 61 | + } |
54 | 62 | $httpOnlySafe = wfHttpOnlySafe() && $wgCookieHttpOnly; |
55 | 63 | wfDebugLog( 'cookie', |
56 | 64 | 'setcookie: "' . implode( '", "', |
57 | 65 | array( |
58 | | - $wgCookiePrefix . $name, |
| 66 | + $prefix . $name, |
59 | 67 | $value, |
60 | 68 | $expire, |
61 | 69 | $wgCookiePath, |
62 | | - $wgCookieDomain, |
| 70 | + $domain, |
63 | 71 | $wgCookieSecure, |
64 | 72 | $httpOnlySafe ) ) . '"' ); |
65 | | - setcookie( $wgCookiePrefix . $name, |
| 73 | + setcookie( $prefix . $name, |
66 | 74 | $value, |
67 | 75 | $expire, |
68 | 76 | $wgCookiePath, |
69 | | - $wgCookieDomain, |
| 77 | + $domain, |
70 | 78 | $wgCookieSecure, |
71 | 79 | $httpOnlySafe ); |
72 | 80 | } |