wp_setcookie

Definition:
function wp_setcookie($username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false) {}

Sets a cookie for a user who just logged in. This function is deprecated.

Parameters

  • string $username: The user’s username
  • string $password: Optional. The user’s password
  • bool $already_md5: Optional. Whether the password has already been through MD5
  • string $home: Optional. Will be used instead of COOKIEPATH if set
  • string $siteurl: Optional. Will be used instead of SITECOOKIEPATH if set
  • bool $remember: Optional. Remember that the user is logged in

Source code

function wp_setcookie($username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false) {

	_deprecated_function( __FUNCTION__, '2.5', 'wp_set_auth_cookie()' );

	$user = get_user_by('login', $username);

	wp_set_auth_cookie($user->ID, $remember);

}

4093

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: