Filter hook 'secure_auth_cookie'

in WP Core File wp-includes/pluggable.php at line 1025

View Source

secure_auth_cookie

Filter Hook
Description
Filters whether the auth cookie should only be sent over HTTPS.

Hook Information

File Location wp-includes/pluggable.php View on GitHub
Hook Type Filter
Line Number 1025

Hook Parameters

Type Name Description
bool $secure Whether the cookie should only be sent over HTTPS.
int $user_id User ID.

Usage Examples

Basic Usage
<?php
// Hook into secure_auth_cookie
add_filter('secure_auth_cookie', 'my_custom_filter', 10, 2);

function my_custom_filter($secure, $user_id) {
    // Your custom filtering logic here
    return $secure;
}

Source Code Context

wp-includes/pluggable.php:1025 - How this hook is used in WordPress core
<?php
1020  		 * @since 3.1.0
1021  		 *
1022  		 * @param bool $secure  Whether the cookie should only be sent over HTTPS.
1023  		 * @param int  $user_id User ID.
1024  		 */
1025  		$secure = apply_filters( 'secure_auth_cookie', $secure, $user_id );
1026  
1027  		/**
1028  		 * Filters whether the logged in cookie should only be sent over HTTPS.
1029  		 *
1030  		 * @since 3.1.0

PHP Documentation

<?php
/**
		 * Filters whether the auth cookie should only be sent over HTTPS.
		 *
		 * @since 3.1.0
		 *
		 * @param bool $secure  Whether the cookie should only be sent over HTTPS.
		 * @param int  $user_id User ID.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.