Action hook 'auth_cookie_bad_hash'

in WP Core File wp-includes/pluggable.php at line 801

View Source

auth_cookie_bad_hash

Action Hook
Description
Fires if a bad authentication cookie hash is encountered. }

Hook Information

File Location wp-includes/pluggable.php View on GitHub
Hook Type Action
Line Number 801

Hook Parameters

Type Name Description
string[] $cookie_elements { Authentication cookie components. None of the components should be assumed to be valid as they come directly from a client-provided cookie value.

Usage Examples

Basic Usage
<?php
// Hook into auth_cookie_bad_hash
add_action('auth_cookie_bad_hash', 'my_custom_function', 10, 1);

function my_custom_function($cookie_elements) {
    // Your custom code here
}

Source Code Context

wp-includes/pluggable.php:801 - How this hook is used in WordPress core
<?php
 796  			 *     @type string $token      User's session token used.
 797  			 *     @type string $hmac       The security hash for the cookie.
 798  			 *     @type string $scheme     The cookie scheme to use.
 799  			 * }
 800  			 */
 801  			do_action( 'auth_cookie_bad_hash', $cookie_elements );
 802  			return false;
 803  		}
 804  
 805  		$manager = WP_Session_Tokens::get_instance( $user->ID );
 806  		if ( ! $manager->verify( $token ) ) {

PHP Documentation

<?php
/**
			 * Fires if a bad authentication cookie hash is encountered.
			 *
			 * @since 2.7.0
			 *
			 * @param string[] $cookie_elements {
			 *     Authentication cookie components. None of the components should be assumed
			 *     to be valid as they come directly from a client-provided cookie value.
			 *
			 *     @type string $username   User's username.
			 *     @type string $expiration The time the cookie expires as a UNIX timestamp.
			 *     @type string $token      User's session token used.
			 *     @type string $hmac       The security hash for the cookie.
			 *     @type string $scheme     The cookie scheme to use.
			 * }
			 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.