Sets a cookie for a user who just logged in. This function is deprecated.
Description
See also
Parameters
$username
stringrequired- The user’s username
$password
stringoptional- The user’s password
Default:
''
$already_md5
booloptional- Whether the password has already been through MD5
Default:
false
$home
stringoptional- Will be used instead of COOKIEPATH if set
Default:
''
$siteurl
stringoptional- Will be used instead of SITECOOKIEPATH if set
Default:
''
$remember
booloptional- Remember that the user is logged in
Default:
false
Source
function wp_setcookie($username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false) {
_deprecated_function( __FUNCTION__, '2.5.0', 'wp_set_auth_cookie()' );
$user = get_user_by('login', $username);
wp_set_auth_cookie($user->ID, $remember);
}
Changelog
Version | Description |
---|---|
2.5.0 | Use wp_set_auth_cookie() |
1.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.