WordPress filter hook · part of WordPress core

secure_auth_cookie

A WordPress core filter that 17 plugins also fire themselves, running on 7M+ sites between them.

“This filter is documented in wp-includes/pluggable.php”

How to use secure_auth_cookie

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'secure_auth_cookie', function( $secure, $user_id ) {
	// Change $secure here.
	return $secure;
}, 10, 2 );

Argument names come from ManageWP Worker'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 →

17 plugins that fire secure_auth_cookie

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( 'secure_auth_cookie', $browserOriginSecure, $userID ) modules/login-security/classes/controller/rest.php:394
  2. ManageWP Worker icon ManageWP Worker1+ million installs apply_filters( 'secure_auth_cookie', $secure, $user_id ) src/MMB/Stats.php:523
  3. All-In-One Security (AIOS) icon All-In-One Security (AIOS)1+ million installs apply_filters( 'secure_auth_cookie', $secure, get_current_user_id() ) includes/simba-tfa/simba-tfa.php:796
  4. Two Factor Authentication icon Two Factor Authentication20,000+ installs apply_filters( 'secure_auth_cookie', $secure, get_current_user_id() ) simba-tfa/simba-tfa.php:796
  5. Instant Back/Forward icon Instant Back/Forward10,000+ installs apply_filters( 'secure_auth_cookie', $secure, $user_id ) includes/bfcache-opt-in.php:308
  6. WP Remote Users Sync icon WP Remote Users Sync5,000+ installs apply_filters( 'secure_auth_cookie', $secure, $user_id ) functions.php:182
  7. Servebolt Optimizer icon Servebolt Optimizer1,000+ installs apply_filters( 'secure_auth_cookie', $secure, $userId ) src/Servebolt/FullPageCache/FullPageCacheAuthHandling.php:152
  8. Hide WP icon Hide WP900+ installs apply_filters( 'secure_auth_cookie', $secure, $user_id ) hide-wp.php:208
  9. SameSite Cookies icon SameSite Cookies700+ installs apply_filters( 'secure_auth_cookie', $secure, $user_id ) samesite.php:72
  10. WPO365 icon WPO365200+ installs apply_filters( 'secure_auth_cookie', $secure, $user_id ) wpo365-samesite.php:74
  11. RS Remote Site Manager icon RS Remote Site Manager90+ installs apply_filters( 'secure_auth_cookie', $secure, $user_id ) includes/class-db-upgrade-handler.php:279
  12. Ultimate Multisite icon Ultimate Multisite80+ installs apply_filters( 'secure_auth_cookie', $secure, $user_id ) inc/sso/auth-functions.php:78
  13. Checkout Gateway for Paddle icon Checkout Gateway for Paddle80+ installs apply_filters( 'secure_auth_cookie', $secure, $user_id ) includes/User.php:347
  14. vjoon WordPress Adapter icon vjoon WordPress Adapter10+ installs apply_filters( 'secure_auth_cookie', $secure, $user_id ) src/Authorization.php:88
  15. Ultimate Security icon Ultimate Security10+ installs apply_filters( 'secure_auth_cookie', is_ssl(), $user_id ) php/src/Modules/Authentication/ActiveLogins.php:340
  16. Signclave icon SignclaveFewer than 10 installs apply_filters( 'secure_auth_cookie', $this->isSecureRequest(), $user->ID ) src/Saml/Handler.php:514
  17. Performance Optimisation icon Performance OptimisationFewer than 10 installs apply_filters( 'secure_auth_cookie', $secure, $user_id ) includes/Cache/class-bfcache.php:218

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.