Action hook 'auth_cookie_bad_session_token'

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

View Source

auth_cookie_bad_session_token

Action Hook
Description
Fires if a bad session token is encountered. }

Hook Information

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

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_session_token
add_action('auth_cookie_bad_session_token', 'my_custom_function', 10, 1);

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

Source Code Context

wp-includes/pluggable.php:823 - How this hook is used in WordPress core
<?php
 818  			 *     @type string $token      User's session token used.
 819  			 *     @type string $hmac       The security hash for the cookie.
 820  			 *     @type string $scheme     The cookie scheme to use.
 821  			 * }
 822  			 */
 823  			do_action( 'auth_cookie_bad_session_token', $cookie_elements );
 824  			return false;
 825  		}
 826  
 827  		// Ajax/POST grace period set above.
 828  		if ( $expiration < time() ) {

PHP Documentation

<?php
/**
			 * Fires if a bad session token is encountered.
			 *
			 * @since 4.0.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.