Skip to content

Commit 0bd55b5

Browse files
committed
Docs: Clarify behavior in wp_set_auth_cookie().
1 parent 2da7a59 commit 0bd55b5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/wp-includes/pluggable.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,11 +1038,13 @@ function wp_parse_auth_cookie( $cookie = '', $scheme = '' ) {
10381038

10391039
if ( ! function_exists( 'wp_set_auth_cookie' ) ) :
10401040
/**
1041-
* Sets the authentication cookies based on user ID.
1041+
* Sets the authentication cookies for a given user ID.
10421042
*
1043-
* The $remember parameter increases the time that the cookie will be kept. The
1044-
* default the cookie is kept without remembering is two days. When $remember is
1045-
* set, the cookies will be kept for 14 days or two weeks.
1043+
* The `$remember` parameter controls cookie persistence:
1044+
* - If true, the cookie is persistent (default 14 days, filterable via `auth_cookie_expiration`).
1045+
* - If false, the cookie is a browser session cookie (expires when the browser closes).
1046+
* Internally, `auth_cookie_expiration` is still applied (default 2 days),
1047+
* but the HTTP cookie `$expire` is set to 0, so it won’t persist beyond the session.
10461048
*
10471049
* @since 2.5.0
10481050
* @since 4.3.0 Added the `$token` parameter.

0 commit comments

Comments
 (0)