Changeset 14486
- Timestamp:
- 07/16/2025 02:29:30 AM (12 months ago)
- Location:
- sites/trunk/common/includes/wporg-sso
- Files:
-
- 2 edited
-
class-wporg-sso.php (modified) (2 diffs)
-
wp-plugin.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/wporg-sso/class-wporg-sso.php
r14340 r14486 28 28 ]; 29 29 30 public $sso_host = 'login.wordpress.org'; 31 public $sso_host_url = ''; 32 public $sso_login_url = ''; 33 public $sso_signup_url = ''; 30 public $sso_host = 'login.wordpress.org'; 31 public $sso_cookie_host = '.wordpress.org'; 32 public $sso_host_url = ''; 33 public $sso_login_url = ''; 34 public $sso_signup_url = ''; 34 35 35 36 public $host = ''; … … 51 52 $this->sso_host .= ':' . parse_url( home_url(), PHP_URL_PORT ); 52 53 } 54 55 $this->sso_cookie_host = defined( 'COOKIE_DOMAIN' ) ? COOKIE_DOMAIN : ''; 53 56 } else { 54 57 $this->sso_host_url = 'https://' . $this->sso_host; -
sites/trunk/common/includes/wporg-sso/wp-plugin.php
r14446 r14486 582 582 ); 583 583 584 /* 585 * If we're not on the SSO cookie host, clear the cookies locally before redirecting. 586 * Upon redirect back, these previous cookies should be invalid as the session is destroyed. 587 */ 588 if ( $this->sso_cookie_host !== COOKIE_DOMAIN ) { 589 wp_clear_auth_cookie(); 590 } 591 584 592 $this->_safe_redirect( $remote_logout_url ); 585 593 exit; … … 686 694 /** 687 695 * Log out a user and destroy the session. 696 * 697 * NOTE: This handles `action=remote-logout` requests. The remote-logout query var 698 * is not actually used, but is present as a legacy of previous implementations. 688 699 */ 689 700 protected function _maybe_perform_remote_logout() { … … 699 710 } 700 711 701 // Perform the logout. This will destroy the session, logging the user out of all sites. 712 // If the session noted in the remote-logout is different from current, destroy that session first. 713 $current_token = wp_get_session_token(); 714 if ( 715 $remote_token['session_token'] && 716 wp_get_session_token() !== $remote_token['session_token'] 717 ) { 718 $manager = WP_Session_Tokens::get_instance( $remote_token['user']->ID ); 719 $manager->destroy( $remote_token['session_token'] ); 720 } 721 722 // Perform the logout. This will destroy the *current* session, logging the user out of all sites. 702 723 wp_logout(); 703 724
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)