send_auth_cookies filter-hookWP 4.7.4

Allows preventing auth cookies from actually being sent to the client.

Usage

add_filter( 'send_auth_cookies', 'wp_kama_send_auth_cookies_filter', 10, 6 );

/**
 * Function for `send_auth_cookies` filter-hook.
 * 
 * @param bool   $send       Whether to send auth cookies to the client.
 * @param int    $expire     The time the login grace period expires as a UNIX timestamp. Zero when clearing cookies.
 * @param int    $expiration The time when the logged-in authentication cookie expires as a UNIX timestamp. Zero when clearing cookies.
 * @param int    $user_id    User ID. Zero when clearing cookies.
 * @param string $scheme     Authentication scheme. Values include 'auth' or 'secure_auth'. Empty string when clearing cookies.
 * @param string $token      User's session token to use for this cookie. Empty string when clearing cookies.
 *
 * @return bool
 */
function wp_kama_send_auth_cookies_filter( $send, $expire, $expiration, $user_id, $scheme, $token ){

	// filter...
	return $send;
}
$send(true|false)
Whether to send auth cookies to the client.
Default: true
$expire(int)
The time the login grace period expires as a UNIX timestamp. Zero when clearing cookies.
Default: 12 hours past the cookie's expiration time
$expiration(int)
The time when the logged-in authentication cookie expires as a UNIX timestamp. Zero when clearing cookies.
Default: 14 days from now
$user_id(int)
User ID. Zero when clearing cookies.
$scheme(string)
Authentication scheme. Values include 'auth' or 'secure_auth'. Empty string when clearing cookies.
$token(string)
User's session token to use for this cookie. Empty string when clearing cookies.

Changelog

Since 4.7.4 Introduced.
Since 6.2.0 The $expire, $expiration, $user_id, $scheme, and $token parameters were added.

Where the hook is called

wp_set_auth_cookie()
send_auth_cookies
wp_clear_auth_cookie()
send_auth_cookies
wp-includes/pluggable.php 1089
if ( ! apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token ) ) {
wp-includes/pluggable.php 1117
if ( ! apply_filters( 'send_auth_cookies', true, 0, 0, 0, '', '' ) ) {

Where the hook is used in WordPress

Usage not found.