set_logged_in_cookie

动作钩子
do_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in', $token )
参数
  • (string) $logged_in_cookie The logged-in cookie value.
    Required:
  • (int) $expire The time the login grace period expires as a UNIX timestamp. Default is 12 hours past the cookie's expiration time.
    Required:
  • (int) $expiration The time when the logged-in authentication cookie expires as a UNIX timestamp. Default is 14 days from now.
    Required:
  • (int) $user_id User ID.
    Required:
  • (string) $scheme Authentication scheme. Default 'logged_in'.
    Required:
  • (string) $token User's session token to use for this cookie.
    Required:
定义位置
相关勾子
secure_logged_in_cookieset_comment_cookiessecure_signon_cookieset_auth_cookiesend_auth_cookies
相关方法
wp_validate_logged_in_cookiewp_set_comment_cookiesis_user_logged_inwp_set_auth_cookieget_url_in_contentwp_setcookie
引入
4.9.0
弃用
-

set_logged_in_cookie 是一个WordPress函数,当用户登录时为其设置一个cookie: 这个函数被用来保持用户在访问网站之间的登录状态。

在设置登录的身份验证cookie之前立即触发。

do_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in', $token );

常见问题

FAQs
查看更多 >