0|A@}Ax'Ah|A@pAКAمA(AHمApمA EU=UО}AX1|AX)mA/|APmA`AzAxlAAlAhŁA`}mA#mAAЁmA0|A0|A8uA/|AuA0|A/|A/|AX)mA/|ApvA/|A/|AX1|AuAPiuA`3wAX1|AzAX1|AUX1|A8uAX1|A8uApvAX)mAx'Ax'A8uAh|Ax'Ah|Ax'A@pA@pA8uAКAКAx'AمAمAx'AAzAAA@U}AЁmAО}AО}AzAhmAHمA@}AHمAمAHمAمAX)mAX)mApمAHمAxUمAمApمAڅApمAXڅAhŁAhŁAhŁAhŁAX)mAhŁAzAhŁA UAAHzAAX)mA 7U8U@uA  H8U@HU  `8Up8U p7U7U 8U (7U@7U 8U@uA  9U@uA  89U@U  P9U`9U x9U (9U9U@8uA  9U 9U :U;U=U`>U@8uA  :U@hV @8uA  `:U x:U:U@uA  :U H:U:U 8:U:U@@aV @PU  (;U;U;U@uA  p;U@(zA  ;U ;U@;U@uA  ;U@U @uA  UP>U@uA  >U@(zA  8>U =U=U 9U9U x>U@A  >U@uA  >U@`U @uA  (?U@ U @U @uA @ȕV  ?U ?U?U h?U?U@Utoken. * * @since 4.0.0 * * @param string $token Session token to update. * @param array $session Session information. */ final public function update( $token, $session ) { $verifier = $this->hash_token( $token ); $this->update_session( $verifier, $session ); } /** * Destroys the session with the given token. * * @since 4.0.0 * * @param string $token Session token to destroy. */ final public function destroy( $token ) { $verifier = $this->hash_token( $token ); $this->update_session( $verifier, null ); } /** * Destroys all sessions for this user except the one with the given token (presumably the one in use). * * @since 4.0.0 * * @param string $token_to_keep Session token to keep. */ final public function destroy_others( $token_to_keep ) { $verifier = $this->hash_token( $token_to_keep ); $session = $this->get_session( $verifier ); if ( $session ) { $this->destroy_other_sessions( $verifier ); } else { $this->destroy_all_sessions(); } } /** * Determines whether a session is still valid, based on its expiration timestamp. * * @since 4.0.0 * * @param array $session Session to check. * @return bool Whether session is valid. */ final protected function is_still_valid( $session ) { return $session['expiration'] >= time(); } /** * Destroys all sessions for a user. * * @since 4.0.0 */ final public function destroy_all() { $this->destroy_all_sessions(); } /** * Destroys all sessions for all users. * * @since 4.0.0 */ final public static function destroy_all_for_all_users() { /** This filter is documented in wp-includes/class-wp-session-tokens.php */ $manager = apply_filters( 'session_token_manager', 'WP_User_Meta_Session_Tokens' ); call_user_func( array( $manager, 'drop_sessions' ) ); } /** * Retrieves all sessions for a user. * * @since 4.0.0 * * @return array Sessions for a user. */ final public function get_all() { return array_values( $this->get_sessions() ); } /** * Retrieves all sessions of the user. * * @since 4.0.0 * * @return array Sessions of the user. */ abstract protected function get_sessions(); /** * Retrieves a session based on its verifier (token hash). * * @since 4.0.0 * * @param string $verifier Verifier for the session to retrieve. * @return array|null The session, or null if it does not exist. */ abstract protected function get_session( $verifier ); /** * Updates a session based on its verifier (token hash). * * Omitting the second argument destroys the session. * * @since 4.0.0 * * @param string $verifier Verifier for the session to update. * @param array $session Optional. Session. Omitting this argument destroys the session. */ abstract protected function update_session( $verifier, $session = null ); /** * Destroys all sessions for this user, except the single session with the given verifier. * * @since 4.0.0 * * @param string $verifier Verifier of the session to keep. */ abstract protected function destroy_other_sessions( $verifier ); /** * Destroys all sessions for the user. * * @since 4.0.0 */ abstract protected function destroy_all_sessions(); /** * Destroys all sessions for all users. * * @since 4.0.0 */ public static function drop_sessions() {} }