Filter hook 'secure_signon_cookie'

in WP Core File wp-includes/user.php at line 102

View Source

secure_signon_cookie

Filter Hook
Description
Filters whether to use a secure sign-on cookie. that the cookie will be kept. Default false. }

Hook Information

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

Hook Parameters

Type Name Description
bool $secure_cookie Whether to use a secure sign-on cookie.
array $credentials { Array of entered sign-on data.

Usage Examples

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

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

Source Code Context

wp-includes/user.php:102 - How this hook is used in WordPress core
<?php
  97  	 *     @type string $user_password Password entered.
  98  	 *     @type bool   $remember      Whether to 'remember' the user. Increases the time
  99  	 *                                 that the cookie will be kept. Default false.
 100  	 * }
 101  	 */
 102  	$secure_cookie = apply_filters( 'secure_signon_cookie', $secure_cookie, $credentials );
 103  
 104  	// XXX ugly hack to pass this to wp_authenticate_cookie().
 105  	$auth_secure_cookie = $secure_cookie;
 106  
 107  	add_filter( 'authenticate', 'wp_authenticate_cookie', 30, 3 );

PHP Documentation

<?php
/**
	 * Filters whether to use a secure sign-on cookie.
	 *
	 * @since 3.1.0
	 *
	 * @param bool  $secure_cookie Whether to use a secure sign-on cookie.
	 * @param array $credentials {
	 *     Array of entered sign-on data.
	 *
	 *     @type string $user_login    Username.
	 *     @type string $user_password Password entered.
	 *     @type bool   $remember      Whether to 'remember' the user. Increases the time
	 *                                 that the cookie will be kept. Default false.
	 * }
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/user.php
Related Hooks

Related hooks will be displayed here in future updates.