Skip to content

Commit b289221

Browse files
committed
Docs: Clarify behavior in wp_set_auth_cookie().
Clarifies how long authentication cookies are set for when setting the `$remember` parameter. Props johnbillion, khoipro, rollybueno, shailu25, siliconforks, wildworks, zodiac1978. Fixes #63230. git-svn-id: https://develop.svn.wordpress.org/trunk@61188 602fd350-edb4-49c9-b593-d223f7449a82
1 parent b77fbe6 commit b289221

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
@@ -1047,11 +1047,13 @@ function wp_parse_auth_cookie( $cookie = '', $scheme = '' ) {
10471047

10481048
if ( ! function_exists( 'wp_set_auth_cookie' ) ) :
10491049
/**
1050-
* Sets the authentication cookies based on user ID.
1050+
* Sets the authentication cookies for a given user ID.
10511051
*
1052-
* The $remember parameter increases the time that the cookie will be kept. The
1053-
* default the cookie is kept without remembering is two days. When $remember is
1054-
* set, the cookies will be kept for 14 days or two weeks.
1052+
* The `$remember` parameter controls cookie persistence:
1053+
* - If true, the cookie is persistent (default 14 days, filterable via {@see 'auth_cookie_expiration'}).
1054+
* - If false, the cookie is a browser session cookie (expires when the browser closes).
1055+
* Internally, {@see 'auth_cookie_expiration'} is still applied, to expire the login after
1056+
* two days or when the browser is closed, whichever occurs first.
10551057
*
10561058
* @since 2.5.0
10571059
* @since 4.3.0 Added the `$token` parameter.

0 commit comments

Comments
 (0)