wp_set_auth_cookie


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

Parameters:
  • (int) $user_id User ID
  • (bool) $remember Whether to remember the user
  • (mixed) $secure Whether the admin cookies should only be sent over HTTPS. Default is_ssl().
  • (string) $token Optional. User's session token to use for this cookie.
Defined at:
Change Log:
  • 4: .

Description

Log in a user by setting authentication cookies.

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.

Related Functions

wp_parse_auth_cookie, wp_clear_auth_cookie, wp_generate_auth_cookie, wp_setcookie, wp_validate_auth_cookie

Top Google Results

User discussions

wpseek mobile