Ipstenu (Mika Epstein) on "Error with auth cookie in WordPress 4.4.2"

ساخت وبلاگ

Hi i am facing issues with WordPress 4.4.2 release, I recently updated my website to WordPress 4.4.2 and the auto login code has stopped working also wp_redirect is throwing errors for header already sent.

This same code is working fine in WordPress 4.3.3, is this due to auth cookie functions changed in WordPress 4.4.2

This is the code that I am using for auto login

<br> $creds = array(); $creds['user_login'] = $email; $creds['user_password'] = $password; $creds['remember'] = true; $user = wp_signon( $creds, true); if ( is_wp_error($user) ) { echo "<div class='login-error-msg'>".$user->get_error_message()."</div>"; } else{ $user_id = $user->ID; wp_set_auth_cookie($user_id ); wp_set_current_user($user_id ); do_action( 'wp_login', $user_login ); $redirect_to = $_SERVER['REQUEST_URI']; wp_safe_redirect($redirect_to); exit; }

- - , .

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 191 تاريخ : پنجشنبه 13 اسفند 1394 ساعت: 12:58