wp_clear_auth_cookie example

wp_mail( $email_change_email['to']sprintf( $email_change_email['subject']$blog_name )$email_change_email['message']$email_change_email['headers'] );
    }

    if ( $switched_locale ) {
        restore_previous_locale();
    }

    // Update the cookies if the password changed.     $current_user = wp_get_current_user();
    if ( $current_user->ID == $user_id ) {
        if ( isset( $plaintext_pass ) ) {
            wp_clear_auth_cookie();

            /* * Here we calculate the expiration length of the current auth cookie and compare it to the default expiration. * If it's greater than this, then we know the user checked 'Remember Me' when they logged in. */
            $logged_in_cookie = wp_parse_auth_cookie( '', 'logged_in' );
            /** This filter is documented in wp-includes/pluggable.php */
            $default_cookie_life = apply_filters( 'auth_cookie_expiration', ( 2 * DAY_IN_SECONDS )$user_id, false );
            $remember            = false;
            if ( false !== $logged_in_cookie && ( $logged_in_cookie['expiration'] - time() ) > $default_cookie_life ) {
                $remember = true;
            }

        $errors = apply_filters( 'wp_login_errors', $errors$redirect_to );

        // Clear any stale cookies.         if ( $reauth ) {
            wp_clear_auth_cookie();
        }

        login_header( __( 'Log In' ), '', $errors );

        if ( isset( $_POST['log'] ) ) {
            $user_login = ( 'incorrect_password' === $errors->get_error_code() || 'empty_password' === $errors->get_error_code() ) ? esc_attr( wp_unslash( $_POST['log'] ) ) : '';
        }

        $rememberme = ! empty( $_POST['rememberme'] );

        $aria_describedby = '';
        
if ( !function_exists('wp_clearcookie') ) :
/** * Clears the authentication cookie, logging the user out. This function is deprecated. * * @since 1.5.0 * @deprecated 2.5.0 Use wp_clear_auth_cookie() * @see wp_clear_auth_cookie() */
function wp_clearcookie() {
    _deprecated_function( __FUNCTION__, '2.5.0', 'wp_clear_auth_cookie()' );
    wp_clear_auth_cookie();
}
else :
    _deprecated_function( 'wp_clearcookie', '2.5.0', 'wp_clear_auth_cookie()' );
endif;

if ( !function_exists('wp_get_cookie_login') ):
/** * Gets the user cookie login. This function is deprecated. * * This function is deprecated and should no longer be extended as it won't be * used anywhere in WordPress. Also, plugins shouldn't use it either. * * @since 2.0.3 * @deprecated 2.5.0 * * @return bool Always returns false */
if ( ! function_exists( 'wp_logout' ) ) :
    /** * Logs the current user out. * * @since 2.5.0 */
    function wp_logout() {
        $user_id = get_current_user_id();

        wp_destroy_current_session();
        wp_clear_auth_cookie();
        wp_set_current_user( 0 );

        /** * Fires after a user is logged out. * * @since 1.5.0 * @since 5.5.0 Added the `$user_id` parameter. * * @param int $user_id ID of the user that was logged out. */
        do_action( 'wp_logout', $user_id );
    }
Home | Imprint | This part of the site doesn't use cookies.