diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index d108e4a457..b097bca227 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -649,7 +649,10 @@ if ( !function_exists('wp_set_auth_cookie') ) : */ function wp_set_auth_cookie($user_id, $remember = false, $secure = '') { if ( $remember ) { - $expiration = $expire = time() + apply_filters('auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember); + $expiration = time() + apply_filters('auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember); + // Ensure the browser will continue to send the cookie after the expiration time is reached. + // Needed for the login grace period in wp_validate_auth_cookie(). + $expire = $expiration + ( 12 * HOUR_IN_SECONDS ); } else { $expiration = time() + apply_filters('auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user_id, $remember); $expire = 0;