wppaste
WordPress

apply_filters( 'send_auth_cookies', bool $send, int $expire, int $expiration, int $user_id, string $scheme, string $token )

Since
4.7.4, 6.2.0
Allows preventing auth cookies from actually being sent to the client.

Compatibility

WordPress
since 6.2.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$sendbool
Whether to send auth cookies to the client. Default true.
$expireint
The time the login grace period expires as a UNIX timestamp.
Default is 12 hours past the cookie's expiration time. Zero when clearing cookies.
$expirationint
The time when the logged-in authentication cookie expires as a UNIX timestamp.
Default is 14 days from now. Zero when clearing cookies.
$user_idint
User ID. Zero when clearing cookies.
$schemestring
Authentication scheme. Values include 'auth' or 'secure_auth'.
Empty string when clearing cookies.
$tokenstring
User's session token to use for this cookie. Empty string when clearing cookies.

Where this hook fires · 2

  • wp-includes/pluggable.php:1189wp_set_auth_cookie()
  • wp-includes/pluggable.php:1217wp_clear_auth_cookie()

Source code

<?php		 *                           Default is 14 days from now. 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.		 */		if ( ! apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token ) ) {			return;		} 		setcookie( $auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );		setcookie( $auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );		setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );

Changelog

Introduced in 4.7.4. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

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

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.