Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2787,7 +2787,7 @@ |
2788 | 2788 | # hasn't already been set to the desired value (that causes errors) |
2789 | 2789 | ini_set( 'session.save_handler', $wgSessionHandler ); |
2790 | 2790 | } |
2791 | | - $httpOnlySafe = wfHttpOnlySafe(); |
| 2791 | + $httpOnlySafe = wfHttpOnlySafe() && $wgCookieHttpOnly; |
2792 | 2792 | wfDebugLog( 'cookie', |
2793 | 2793 | 'session_set_cookie_params: "' . implode( '", "', |
2794 | 2794 | array( |
— | — | @@ -2795,13 +2795,8 @@ |
2796 | 2796 | $wgCookiePath, |
2797 | 2797 | $wgCookieDomain, |
2798 | 2798 | $wgCookieSecure, |
2799 | | - $httpOnlySafe && $wgCookieHttpOnly ) ) . '"' ); |
2800 | | - if( $httpOnlySafe && $wgCookieHttpOnly ) { |
2801 | | - session_set_cookie_params( 0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgCookieHttpOnly ); |
2802 | | - } else { |
2803 | | - // PHP 5.1 throws warnings if you pass the HttpOnly parameter for 5.2. |
2804 | | - session_set_cookie_params( 0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure ); |
2805 | | - } |
| 2799 | + $httpOnlySafe ) ) . '"' ); |
| 2800 | + session_set_cookie_params( 0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $httpOnlySafe ); |
2806 | 2801 | session_cache_limiter( 'private, must-revalidate' ); |
2807 | 2802 | if ( $sessionId ) { |
2808 | 2803 | session_id( $sessionId ); |
Index: trunk/phase3/includes/WebResponse.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | if ( $expire == 0 ) { |
35 | 35 | $expire = time() + $wgCookieExpiration; |
36 | 36 | } |
37 | | - $httpOnlySafe = wfHttpOnlySafe(); |
| 37 | + $httpOnlySafe = wfHttpOnlySafe() && $wgCookieHttpOnly; |
38 | 38 | wfDebugLog( 'cookie', |
39 | 39 | 'setcookie: "' . implode( '", "', |
40 | 40 | array( |
— | — | @@ -43,25 +43,14 @@ |
44 | 44 | $wgCookiePath, |
45 | 45 | $wgCookieDomain, |
46 | 46 | $wgCookieSecure, |
47 | | - $httpOnlySafe && $wgCookieHttpOnly ) ) . '"' ); |
48 | | - if( $httpOnlySafe && isset( $wgCookieHttpOnly ) ) { |
49 | | - setcookie( $wgCookiePrefix . $name, |
50 | | - $value, |
51 | | - $expire, |
52 | | - $wgCookiePath, |
53 | | - $wgCookieDomain, |
54 | | - $wgCookieSecure, |
55 | | - $wgCookieHttpOnly ); |
56 | | - } else { |
57 | | - // setcookie() fails on PHP 5.1 if you give it future-compat paramters. |
58 | | - // stab stab! |
59 | | - setcookie( $wgCookiePrefix . $name, |
60 | | - $value, |
61 | | - $expire, |
62 | | - $wgCookiePath, |
63 | | - $wgCookieDomain, |
64 | | - $wgCookieSecure ); |
65 | | - } |
| 47 | + $httpOnlySafe ) ) . '"' ); |
| 48 | + setcookie( $wgCookiePrefix . $name, |
| 49 | + $value, |
| 50 | + $expire, |
| 51 | + $wgCookiePath, |
| 52 | + $wgCookieDomain, |
| 53 | + $wgCookieSecure, |
| 54 | + $httpOnlySafe ); |
66 | 55 | } |
67 | 56 | } |
68 | 57 | |
— | — | @@ -91,4 +80,4 @@ |
92 | 81 | return $this->cookies[$name]; |
93 | 82 | } |
94 | 83 | } |
95 | | -} |
\ No newline at end of file |
| 84 | +} |