Index: branches/wmf/1.18wmf1/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 | } |
— | — | @@ -127,7 +135,7 @@ |
128 | 136 | * @param $value String: value to give cookie |
129 | 137 | * @param $expire Int: number of seconds til cookie expires |
130 | 138 | */ |
131 | | - public function setcookie( $name, $value, $expire = 0 ) { |
| 139 | + public function setcookie( $name, $value, $expire = 0, $prefix = null, $domain = null ) { |
132 | 140 | $this->cookies[$name] = $value; |
133 | 141 | } |
134 | 142 | |
Property changes on: branches/wmf/1.18wmf1/includes/WebResponse.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
135 | 143 | Merged /branches/new-installer/phase3/includes/WebResponse.php:r43664-66004 |
136 | 144 | Merged /branches/wmf-deployment/includes/WebResponse.php:r53381 |
137 | 145 | Merged /branches/REL1_15/phase3/includes/WebResponse.php:r51646 |
138 | 146 | Merged /branches/sqlite/includes/WebResponse.php:r58211-58321 |
139 | 147 | Merged /trunk/phase3/includes/WebResponse.php:r92580,92634,92713,92762,92765,92791,92854,92884,92886-92887,92894,92898,92907,92932,92958,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93818-93822,93847,93858,93891,93935-93936,93977,94058,94062,94068,94107,94155,94211,94216,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94995-94997,95023,95042,95072-95073,95155,95327,95332,95410,95422,95426,95442,95468,95601,95812,96178,96182,97810,98578,98598,98656,98990,99304,99308,99349,99694,100219,100221,100223,100226,100239,100242 |