send_auth_cookies
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
send_auth_cookies
send_auth_cookies
wp-includes/pluggable.php 1185
if ( ! apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token ) ) {
wp-includes/pluggable.php 1213
if ( ! apply_filters( 'send_auth_cookies', true, 0, 0, 0, '', '' ) ) {