Skip to content

Commit d659227

Browse files
Initialize expire and expiration variables and simplify the conditional
1 parent bd84642 commit d659227

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/wp-includes/pluggable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,9 @@ function wp_parse_auth_cookie( $cookie = '', $scheme = '' ) {
984984
* @param string $token Optional. User's session token to use for this cookie.
985985
*/
986986
function wp_set_auth_cookie( $user_id, $remember = false, $secure = '', $token = '' ) {
987+
$expire = 0;
988+
$expiration = time() + ( 2 * DAY_IN_SECONDS );
989+
987990
if ( $remember ) {
988991
/**
989992
* Filters the duration of the authentication cookie expiration period.
@@ -1001,9 +1004,6 @@ function wp_set_auth_cookie( $user_id, $remember = false, $secure = '', $token =
10011004
* Needed for the login grace period in wp_validate_auth_cookie().
10021005
*/
10031006
$expire = $expiration + ( 12 * HOUR_IN_SECONDS );
1004-
} else {
1005-
$expiration = time() + ( 2 * DAY_IN_SECONDS );
1006-
$expire = 0;
10071007
}
10081008

10091009
if ( '' === $secure ) {

0 commit comments

Comments
 (0)