0
我想为登录用户存储1周的Cookie,请帮助我。 我正在使用此功能,但如何设置1个星期的饼干在这个功能请帮助。如何在wordpress中设置cookie一周?
function renew_wp_cookie() {
global $current_user;
get_currentuserinfo();
$userinnow = $current_user->user_login;
if (is_user_logged_in()) {
wp_set_auth_cookie($userinnow, $remember, $secure);
}
else wp_clear_auth_cookie();
}
参考的行号647 https://core.trac.wordpress.org/browser/tags/3.8/src /wp-includes/pluggable.php#L0 .----如果可能,您可以根据需要覆盖wp_set_auth_cookies函数并覆盖到期时间。 –