Action hook 'auth_cookie_expired'

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

View Source

auth_cookie_expired

Action Hook
Description
Fires once an authentication cookie has expired. }

Hook Information

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

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

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

Source Code Context

wp-includes/pluggable.php:746 - How this hook is used in WordPress core
<?php
 741  			 *     @type string $token      User's session token used.
 742  			 *     @type string $hmac       The security hash for the cookie.
 743  			 *     @type string $scheme     The cookie scheme to use.
 744  			 * }
 745  			 */
 746  			do_action( 'auth_cookie_expired', $cookie_elements );
 747  			return false;
 748  		}
 749  
 750  		$user = get_user_by( 'login', $username );
 751  		if ( ! $user ) {

PHP Documentation

<?php
/**
			 * Fires once an authentication cookie has expired.
			 *
			 * @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.