token.
*
* @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() {}
}
Fatal error: Uncaught Error: Class 'WP_Session_Tokens' not found in /var/www/html/revistacentral.com.br/web/wp-includes/class-wp-user-meta-session-tokens.php:17
Stack trace:
#0 /var/www/html/revistacentral.com.br/web/wp-settings.php(206): require()
#1 /var/www/html/revistacentral.com.br/web/wp-config.php(94): require_once('/var/www/html/r...')
#2 /var/www/html/revistacentral.com.br/web/wp-load.php(50): require_once('/var/www/html/r...')
#3 /var/www/html/revistacentral.com.br/web/wp-blog-header.php(13): require_once('/var/www/html/r...')
#4 /var/www/html/revistacentral.com.br/web/index.php(17): require('/var/www/html/r...')
#5 {main}
thrown in /var/www/html/revistacentral.com.br/web/wp-includes/class-wp-user-meta-session-tokens.php on line 17
Fatal error: Uncaught Error: Call to a member function set() on null in /var/www/html/revistacentral.com.br/web/wp-includes/l10n.php:856
Stack trace:
#0 /var/www/html/revistacentral.com.br/web/wp-includes/l10n.php(959): load_textdomain('default', '/var/www/html/r...', 'pt_BR')
#1 /var/www/html/revistacentral.com.br/web/wp-includes/class-wp-fatal-error-handler.php(49): load_default_textdomain()
#2 [internal function]: WP_Fatal_Error_Handler->handle()
#3 {main}
thrown in /var/www/html/revistacentral.com.br/web/wp-includes/l10n.php on line 856