Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/265930

Change subject: Revert "Only delete cookies which are actually set"
......................................................................

Revert "Only delete cookies which are actually set"

It would be better for core to do it in WebResponse.

This reverts commit 6be2735a3788b129fd55433e5f2300455a3af1eb.

Change-Id: I61d14bf80fa7c857dec9cffb366dc3f84dbb4faf
---
M includes/session/CentralAuthSessionProvider.php
1 file changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/30/265930/1

diff --git a/includes/session/CentralAuthSessionProvider.php 
b/includes/session/CentralAuthSessionProvider.php
index 53ce900..cf9b6b7 100644
--- a/includes/session/CentralAuthSessionProvider.php
+++ b/includes/session/CentralAuthSessionProvider.php
@@ -308,7 +308,7 @@
                        );
                        foreach ( $cookies as $name => $value ) {
                                if ( $value === false ) {
-                                       $this->clearCookie( $request, 
$response, $name, $options );
+                                       $response->clearCookie( $name, $options 
);
                                } else {
                                        if ( $extendedExpiry !== null && 
in_array( $name, $extendedCookies ) ) {
                                                $expiry = time() + 
(int)$extendedExpiry;
@@ -326,21 +326,21 @@
                        $metadata['CentralAuthSource'] = 'Local';
                        $session->setProviderMetadata( $metadata );
 
-                       $this->clearCookie( $request, $response, 'User', 
$this->centralCookieOptions );
-                       $this->clearCookie( $request, $response, 'Token', 
$this->centralCookieOptions );
-                       $this->clearCookie( $request, $response, 
$this->params['centralSessionName'],
+                       $response->clearCookie( 'User', 
$this->centralCookieOptions );
+                       $response->clearCookie( 'Token', 
$this->centralCookieOptions );
+                       $response->clearCookie( 
$this->params['centralSessionName'],
                                array( 'prefix' => '' ) + 
$this->centralCookieOptions );
                }
 
                if ( $session->shouldForceHTTPS() || 
$session->getUser()->requiresHTTPS() ) {
                        // Delete the core cookie and set our own
-                       $this->clearCookie( $request, $response, 'forceHTTPS',
+                       $response->clearCookie( 'forceHTTPS',
                                array( 'prefix' => '', 'secure' => false ) + 
$this->cookieOptions );
                        $response->setCookie( 'forceHTTPS', 'true', 
$session->shouldRememberUser() ? 0 : null,
                                array( 'prefix' => '', 'secure' => false ) + 
$this->centralCookieOptions );
                } else {
                        // T56626: Explcitly clear forceHTTPS cookie when it's 
not wanted
-                       $this->clearCookie( $request, $response, 'forceHTTPS',
+                       $response->clearCookie( 'forceHTTPS',
                                array( 'prefix' => '', 'secure' => false ) + 
$this->centralCookieOptions );
                }
 
@@ -363,11 +363,11 @@
                CentralAuthUtils::setP3P( $request );
 
                $expiry = time() - 86400;
-               $this->clearCookie( $request, $response, 'User', 
$this->centralCookieOptions );
-               $this->clearCookie( $request, $response, 'Token', 
$this->centralCookieOptions );
-               $this->clearCookie( $request, $response, 
$this->params['centralSessionName'],
+               $response->clearCookie( 'User', $this->centralCookieOptions );
+               $response->clearCookie( 'Token', $this->centralCookieOptions );
+               $response->clearCookie( $this->params['centralSessionName'],
                        array( 'prefix' => '' ) + $this->centralCookieOptions );
-               $this->clearCookie( $request, $response, 'forceHTTPS',
+               $response->clearCookie( 'forceHTTPS',
                        array( 'prefix' => '', 'secure' => false ) + 
$this->centralCookieOptions );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/265930
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61d14bf80fa7c857dec9cffb366dc3f84dbb4faf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to