WordPress filter hook · part of WordPress core
send_auth_cookies
A WordPress core filter that 13 plugins also fire themselves, running on 5.3M+ sites between them.
“Allows preventing auth cookies from actually being sent to the client.”
How to use send_auth_cookies
It's a filter: your callback receives the value and 5 more arguments, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'send_auth_cookies', function( $value, $expire, $expiration, $user_id, $scheme, $token ) {
// Change $value here.
return $value;
}, 10, 6 );Argument names come from SameSite Cookies's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
13 plugins that fire send_auth_cookies
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Wordfence Security5+ million installs
apply_filters( 'send_auth_cookies', true, $expire, $expiration, $userID, $scheme, $token )modules/login-security/classes/controller/rest.php:418 -
Breeze Cache300,000+ installs
apply_filters( 'send_auth_cookies', true )inc/functions.php:326 -
Login as User: See the Site as Any User30,000+ installs
apply_filters( 'send_auth_cookies', true, 0, 0, 0, '', '' )includes/class-w357-login-as-user.php:116 -
WP Remote Users Sync5,000+ installs
apply_filters( 'send_auth_cookies', true )functions.php:204 -
Subscriptions for WooCommerce Recurring Payments with Membership Content Restriction800+ installs
apply_filters( 'send_auth_cookies', true )src/Features/LoginAsUser/Services/Impersonator.php:453 -
SameSite Cookies700+ installs
apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token )samesite.php:151 -
Teydea Login Security400+ installs
apply_filters( 'send_auth_cookies', true, 0, 0, 0, '', '' )src/modules/logout-cleanup/class-module-logout-cleanup.php:53 -
WPO365200+ installs
apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token )wpo365-samesite.php:153 -
Ultimate Multisite80+ installs
apply_filters( 'send_auth_cookies', true )inc/sso/auth-functions.php:148 -
vjoon WordPress Adapter10+ installs
apply_filters( 'send_auth_cookies', true )src/Authorization.php:158 -
WP Similar Basic Auth10+ installs
apply_filters( 'send_auth_cookies', true )includes/class-cookie.php:106 -
Admin Powerups for WooCommerceFewer than 10 installs
apply_filters( 'send_auth_cookies', true, $expires, 0, 0, '', '' )src/Modules/SwitchUser/Module.php:789 -
PaintClarityFewer than 10 installs
apply_filters( 'send_auth_cookies', true, time() + $grant, time() + $grant, $uid, 'logged_in', $token )paintops.php:2330
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.