wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_setcookie › WordPress Function

Since1.5.0
Deprecated2.5.0
wp_setcookie ( $username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false )
Parameters: (6)
  • (string) $username The user's username
    Required: Yes
  • (string) $password Optional. The user's password
    Required: No
    Default: (empty)
  • (bool) $already_md5 Optional. Whether the password has already been through MD5
    Required: No
    Default: false
  • (string) $home Optional. Will be used instead of COOKIEPATH if set
    Required: No
    Default: (empty)
  • (string) $siteurl Optional. Will be used instead of SITECOOKIEPATH if set
    Required: No
    Default: (empty)
  • (bool) $remember Optional. Remember that the user is logged in
    Required: No
    Default: false
See:
Defined at:
Codex:

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



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);
}