WPDev.one
Core Function
View Source on Trac ↗

wp_set_auth_cookie()

wp_set_auth_cookie( mixed $user_id, mixed $remember = false, mixed $secure = '', mixed $token = '' )

Sets the authentication cookies based on user ID.

Parameters 2 required

Name / Type Description
$user_id
int

User ID.

Required
$remember
bool

Whether to remember the user.

mixed

(bool | string) $secure 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.

Required
$token
string

Optional. User's session token to use for this cookie.

Return Value

(void)
No return value description available.

Function Information

Since Version
2.5.0
Source File
wp-includes/pluggable.php
Advertisement