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:

functions.php
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.

  1. Wordfence Security icon Wordfence Security5+ million installs apply_filters( 'send_auth_cookies', true, $expire, $expiration, $userID, $scheme, $token ) modules/login-security/classes/controller/rest.php:418
  2. Breeze Cache icon Breeze Cache300,000+ installs apply_filters( 'send_auth_cookies', true ) inc/functions.php:326
  3. Login as User: See the Site as Any User icon 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
  4. WP Remote Users Sync icon WP Remote Users Sync5,000+ installs apply_filters( 'send_auth_cookies', true ) functions.php:204
  5. Subscriptions for WooCommerce Recurring Payments with Membership Content Restriction icon Subscriptions for WooCommerce Recurring Payments with Membership Content Restriction800+ installs apply_filters( 'send_auth_cookies', true ) src/Features/LoginAsUser/Services/Impersonator.php:453
  6. SameSite Cookies icon SameSite Cookies700+ installs apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token ) samesite.php:151
  7. Teydea Login Security icon Teydea Login Security400+ installs apply_filters( 'send_auth_cookies', true, 0, 0, 0, '', '' ) src/modules/logout-cleanup/class-module-logout-cleanup.php:53
  8. WPO365 icon WPO365200+ installs apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token ) wpo365-samesite.php:153
  9. Ultimate Multisite icon Ultimate Multisite80+ installs apply_filters( 'send_auth_cookies', true ) inc/sso/auth-functions.php:148
  10. vjoon WordPress Adapter icon vjoon WordPress Adapter10+ installs apply_filters( 'send_auth_cookies', true ) src/Authorization.php:158
  11. WP Similar Basic Auth icon WP Similar Basic Auth10+ installs apply_filters( 'send_auth_cookies', true ) includes/class-cookie.php:106
  12. Admin Powerups for WooCommerce icon Admin Powerups for WooCommerceFewer than 10 installs apply_filters( 'send_auth_cookies', true, $expires, 0, 0, '', '' ) src/Modules/SwitchUser/Module.php:789
  13. PaintClarity icon 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.