You appear to be a bot. Output may be restricted
Description
Sets the authentication cookies based on user ID.
The $remember parameter increases the time that the cookie will be kept. The default the cookie is kept without remembering is two days. When $remember is set, the cookies will be kept for 14 days or two weeks.
Usage
wp_set_auth_cookie( $user_id, $remember, $secure, $token );
Parameters
- $user_id
- ( int ) required – User ID.
- $remember
- ( bool ) optional – Whether to remember the user.
- $secure
- ( bool|string ) optional – Whether the auth cookie should only be sent over HTTPS. Default is an empty string which means the value of
is_ssl()
will be used. - $token
- ( string ) optional – Optional. User's session token to use for this cookie.
Returns
void
Source
File name: wordpress/wp-includes/pluggable.php
Lines:
101 to 120 of 120
do_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in', $token ); /** * Allows preventing auth cookies from actually being sent to the client. * * @since 4.7.4 * * @param bool $send Whether to send auth cookies to the client. */ if ( ! apply_filters( 'send_auth_cookies', true ) ) { return; } setcookie( $auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true ); setcookie( $auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true ); setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true ); if ( COOKIEPATH != SITECOOKIEPATH ) { setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true ); } }